masala-parser icon indicating copy to clipboard operation
masala-parser copied to clipboard

Put speed test apart unit-test

Open nicolas-zozol opened this issue 7 years ago • 0 comments
trafficstars

Cover tool will run it ultra slow

'expect complex calcul to true and lightening fast': function (test) {

        const calculus = '3 +2*4 -((2*45-78)*2*(6*(9-8)+3*(2-5)  ))';

        let time = new Date().getTime();
        let parsing = multParser().parse(stream.ofString(calculus));
        time = new Date().getTime() - time;

        test.equal(parsing.value, 83, 'complex multiplication');
        // Should be 10 ; Unfortunately cover Agent will make it ultra slow 
        test.ok(time < 200, 'parsing is too slow');

        test.done();
    },

nicolas-zozol avatar Sep 16 '18 15:09 nicolas-zozol