Commit 75c18cec authored by GoshaZotov's avatar GoshaZotov

add tests for MID/MIDB

parent efc7d90a
......@@ -9346,5 +9346,37 @@ $( function () {
strictEqual( oParser.calculate().getValue(), 303, "SUBTOTAL(9,A102:A105)");
} );
test( "Test: \"MID\"", function () {
ws.getRange2( "A101" ).setValue( "Fluid Flow" );
oParser = new parserFormula( "MID(A101,1,5)", "A2", ws );
ok( oParser.parse(), "MID(A101,1,5)" );
strictEqual( oParser.calculate().getValue(), "Fluid", "MID(A101,1,5)");
oParser = new parserFormula( "MID(A101,7,20)", "A2", ws );
ok( oParser.parse(), "MID(A101,7,20)" );
strictEqual( oParser.calculate().getValue(), "Flow", "MID(A101,7,20)");
oParser = new parserFormula( "MID(A101,20,5)", "A2", ws );
ok( oParser.parse(), "MID(A101,20,5)" );
strictEqual( oParser.calculate().getValue(), "", "MID(A101,20,5))");
} );
test( "Test: \"MIDB\"", function () {
ws.getRange2( "A101" ).setValue( "Fluid Flow" );
oParser = new parserFormula( "MIDB(A101,1,5)", "A2", ws );
ok( oParser.parse(), "MIDB(A101,1,5)" );
strictEqual( oParser.calculate().getValue(), "Fluid", "MIDB(A101,1,5)");
oParser = new parserFormula( "MIDB(A101,7,20)", "A2", ws );
ok( oParser.parse(), "MIDB(A101,7,20)" );
strictEqual( oParser.calculate().getValue(), "Flow", "MIDB(A101,7,20)");
oParser = new parserFormula( "MIDB(A101,20,5)", "A2", ws );
ok( oParser.parse(), "MIDB(A101,20,5)" );
strictEqual( oParser.calculate().getValue(), "", "MIDB(A101,20,5))");
} );
wb.dependencyFormulas.unlockRecal();
} );
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