<commit_before>var pipe = require("../lib/nodepipe");
var assert = require("assert");

var FIXFrameDecoder = require("../FIXFrameDecoderHandler");
var FIXParser = require("../FIXParserHandler");

const FIX42 = {version: "FIX.4.2",
		headers:["8", "9", "35", "49", "56", "115?", "128?", "90?", "91?", "34", "50?","142?", "57?", "143?", "116?", "144?", "129?", "145?", "43?", "97?","52", "122?", "212?", "213?", "347?", "369?", "370?"],
		trailers:["39?","89?","10"]};

function TestFIXFrameDecoder(){

    var fix = "8=FIX.4.49=11735=AD34=249=A50=152=20100219-14:33:32.25856=B57=M263=1568=1569=0580=175=2010021860=20100218-00:00:00.00010=202";
    var result = 0;
    var testMsg = fix + "" + fix;
    
    var pipeline = pipe.makePipe({end:function(){}});
    
    pipeline.addHandler(FIXFrameDecoder.makeFIXFrameDecoder());
    pipeline.addHandler( {incoming: function(ctx,evt){ result++; } } );
    
    pipeline.pushIncomingData(testMsg);

    assert.equal(2, result);
}

function TestFIXParser(){

    var fix = "8=FIX.4.49=11635=A34=249=A50=152=20100219-14:33:32.25856=B57=M263=1568=1569=0580=175=2010021860=20100218-00:00:00.00010=133";
    var result = 0;

    
    var pipeline = pipe.makePipe({end:function(){}});
    
    pipeline.addHandler(FIXParser.makeFIXParser(FIX42));
    pipeline.addHandler( {incoming: function(ctx,evt){ console.log(evt); } } );
    
    pipeline.pushIncomingData(fix);

    //assert.equal(2, result);
}

//TestFIXFrameDecoder();
TestFIXParser();<commit_msg>starting to add fix msg creator test<commit_after>var pipe = require("../lib/nodepipe");
var assert = require("assert");

var FIXFrameDecoder = require("../FIXFrameDecoderHandler");
var FIXParser = require("../FIXParserHandler");
var FIXMsgCreator = require("../FIXMsgCreatorHandler");

const FIX42 = {version: "FIX.4.2",
		headers:["8", "9", "35", "49", "56", "115?", "128?", "90?", "91?", "34", "50?","142?", "57?", "143?", "116?", "144?", "129?", "145?", "43?", "97?","52", "122?", "212?", "213?", "347?", "369?", "370?"],
		trailers:["39?","89?","10"]};

function TestFIXFrameDecoder(){

    var fix = "8=FIX.4.49=11735=AD34=249=A50=152=20100219-14:33:32.25856=B57=M263=1568=1569=0580=175=2010021860=20100218-00:00:00.00010=202";
    var result = 0;
    var testMsg = fix + "" + fix;
    
    var pipeline = pipe.makePipe({end:function(){}});
    
    pipeline.addHandler(FIXFrameDecoder.makeFIXFrameDecoder());
    pipeline.addHandler( {incoming: function(ctx,evt){ result++; } } );
    
    pipeline.pushIncomingData(testMsg);

    assert.equal(2, result);
}

function TestFIXParser(){

    var fix = "8=FIX.4.49=11635=A34=249=A50=152=20100219-14:33:32.25856=B57=M263=1568=1569=0580=175=2010021860=20100218-00:00:00.00010=133";
    var result = 0;

    
    var pipeline = pipe.makePipe({end:function(){}});
    
    pipeline.addHandler(FIXParser.makeFIXParser(FIX42));
    pipeline.addHandler( {incoming: function(ctx,evt){ console.log(evt); } } );
    
    pipeline.pushIncomingData(fix);

    //assert.equal(2, result);
}

functioin TestMsgCreator(){
    //TODO
}

//TestFIXFrameDecoder();
TestFIXParser();
{'fraction_non_alphanumeric': 0.23857548061771194, 'fraction_numerical': 0.16514339741569492, 'mean_word_length': 4.977401129943503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6921535', 'n_tokens_mistral': 1560, 'n_tokens_neox': 1252, 'n_words': 183}