Commit 9d179b89 authored by GoshaZotov's avatar GoshaZotov

+ tests for CONVERT formula

parent de7b71fa
...@@ -6798,6 +6798,86 @@ $( function () { ...@@ -6798,6 +6798,86 @@ $( function () {
ok( oParser.parse(), 'CONVERT(CONVERT(100,"ft","m"),"ft","m")' ); ok( oParser.parse(), 'CONVERT(CONVERT(100,"ft","m"),"ft","m")' );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 9.290304, 'CONVERT(CONVERT(100,"ft","m"),"ft","m")' ); strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 9.290304, 'CONVERT(CONVERT(100,"ft","m"),"ft","m")' );
oParser = new parserFormula( 'CONVERT(7,"bit","byte")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(3) - 0, 0.875 );
oParser = new parserFormula( 'CONVERT(7,"admkn","kn")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(14) - 0, 6.99999939524838 );
oParser = new parserFormula( 'CONVERT(7,"admkn","m/s")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 3.6011108 );
oParser = new parserFormula( 'CONVERT(7,"admkn","mph")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 8.0554554 );
oParser = new parserFormula( 'CONVERT(7,"m/h","m/sec")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0019444 );
oParser = new parserFormula( 'CONVERT(7,"m/hr","mph")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0043496 );
oParser = new parserFormula( 'CONVERT(7,"m","mi")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0043496 );
oParser = new parserFormula( 'CONVERT(7,"m","Pica")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 19842.5196850 );
oParser = new parserFormula( 'CONVERT(7,"m","pica")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 1653.5433071 );
oParser = new parserFormula( 'CONVERT(7,"Nmi","pica")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 3062362.2047251 );
oParser = new parserFormula( 'CONVERT(7,"yr","day")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 2556.75 );
oParser = new parserFormula( 'CONVERT(7,"yr","min")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 3681720 );
oParser = new parserFormula( 'CONVERT(7,"day","min")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 10080 );
oParser = new parserFormula( 'CONVERT(7,"hr","sec")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 25200 );
oParser = new parserFormula( 'CONVERT(7,"min","sec")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 420 );
oParser = new parserFormula( 'CONVERT(7,"Pa","mmHg")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0525043 );
oParser = new parserFormula( 'CONVERT(7,"Pa","psi")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0010153 );
oParser = new parserFormula( 'CONVERT(7,"Pa","Torr")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0525045 );
oParser = new parserFormula( 'CONVERT(7,"g","sg")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0004797 );
oParser = new parserFormula( 'CONVERT(7,"g","lbm")', "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0154324 );
} ); } );
test( "Test: \"PRICE\"", function () { test( "Test: \"PRICE\"", function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment