Commit 0ef3cec7 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47250 954022d7-b5bf-4e40-9824-e11837661b57
parent 614bed2d
......@@ -9,25 +9,25 @@
<link rel="stylesheet" href="qunit/qunit-1.11.0.css" type="text/css" media="screen" />
<script type="text/javascript" src="qunit/qunit-1.11.0.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/3rdparty/XRegExp/xregexp-all.js"></script>
<script src="../OfficeWebCommon/downloaderfiles.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/3rdparty/Underscore/underscore-min.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/3rdparty/Sockjs/sockjs-0.3.min.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/docscoapicommon.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/docscoapi.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/Charts/charts.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/commonDefines.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/WebWord/Drawing/Externals.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/WebWord/Drawing/Metafile.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/WebWord/Drawing/AllFonts.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/WebWord/Drawing/GlobalLoaders.js"></script>
<script type="text/javascript" src="../../Common/3rdparty/XRegExp/xregexp-all.js"></script>
<script src="../../Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../../Common/3rdparty/Underscore/underscore-min.js"></script>
<script type="text/javascript" src="../../Common/3rdparty/Sockjs/sockjs-0.3.min.js"></script>
<script type="text/javascript" src="../../Common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../Common/docscoapi.js"></script>
<script type="text/javascript" src="../../Common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../Common/Charts/charts.js"></script>
<script type="text/javascript" src="../../Common/commonDefines.js"></script>
<script type="text/javascript" src="../../Common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../Common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../Common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../Word/Drawing/Externals.js"></script>
<script type="text/javascript" src="../../Word/Drawing/Metafile.js"></script>
<script type="text/javascript" src="../../Word/Drawing/AllFonts.js"></script>
<script type="text/javascript" src="../../Word/Drawing/GlobalLoaders.js"></script>
<script type="text/javascript" src="../utils/utils.js"></script>
<script type="text/javascript" src="../model/clipboard.js"></script>
......@@ -43,7 +43,7 @@
<script type="text/javascript" src="../model/CollaborativeEditing.js"></script>
<script type="text/javascript" src="../model/parserFormula.js"></script>
<script type="text/javascript" src="../model/CellComment.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/NumFormat.js"></script>
<script type="text/javascript" src="../../Common/NumFormat.js"></script>
<script type="text/javascript" src="../model/Serialize.js"></script>
<script type="text/javascript" src="../model/WorkbookElems.js"></script>
<script type="text/javascript" src="../model/Workbook.js"></script>
......@@ -65,46 +65,46 @@
<script type="text/javascript" src="../api.js"></script>
<!--for theme-->
<script type="text/javascript" src="../../OfficeWebCommon/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../OfficeWebCommon/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/WebWord/Editor/SerializeCommon.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/WebWord/Editor/GraphicObjects/ObjectTypes/Format.js"></script>
<script type="text/javascript" src="../../OfficeWebWord/WebWord/apiCommon.js"></script>
<script type="text/javascript" src="../../Common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../Common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../Common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../Word/Editor/SerializeCommon.js"></script>
<script type="text/javascript" src="../../Word/Editor/GraphicObjects/ObjectTypes/Format.js"></script>
<script type="text/javascript" src="../../Word/apiCommon.js"></script>
<!--for chart-->
<script type="text/javascript" src="../../OfficeWebCommon/SerializeCommonWordExcel.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.core.js"></script>
<script type="text/javascript" src="../../Common/SerializeCommonWordExcel.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.core.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.annotate.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.context.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.effects.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.key.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.resizing.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.tooltips.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.common.zoom.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.annotate.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.context.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.effects.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.key.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.resizing.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.tooltips.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.zoom.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.bar.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.bipolar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.bar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.bipolar.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.gantt.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.gantt.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.hbar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.hbar.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.line.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.line.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.pie.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.radar.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.rose.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.rscatter.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.scatter.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.pie.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.radar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.rose.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.rscatter.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.scatter.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.waterfall.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/OfficeExcel.chartProperties.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.waterfall.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.chartProperties.js"></script>
<!--for colors-->
<script src="../../OfficeWebCommon/Charts/libraries/hsv.js"></script>
<script src="../../OfficeWebCommon/Charts/libraries/rgbcolor.js"></script>
<script src="../../Common/Charts/libraries/hsv.js"></script>
<script src="../../Common/Charts/libraries/rgbcolor.js"></script>
<script type="text/javascript" src="FormulaTests.js"></script>
......
......@@ -391,6 +391,107 @@
oParser = new parserFormula("PROPER(\"this is a TITLE\")","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "This Is A Title");
})
test("Test: \"GCD\"",function(){
oParser = new parserFormula("GCD(10,100,50)","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 10);
oParser = new parserFormula("GCD(24.6,36.2)","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 12);
oParser = new parserFormula("GCD(-1,39,52)","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "#NUM!");
})
test("Test: \"FIXED\"",function(){
oParser = new parserFormula("FIXED(1234567,-3)","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "1,235,000");
oParser = new parserFormula("FIXED(.555555,10)","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "0.5555550000");
oParser = new parserFormula("FIXED(1234567.555555,4,TRUE)","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "1234567.5556");
oParser = new parserFormula("FIXED(1234567)","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "1,234,567");
})
test("Test: \"COUNTIF\"",function(){
ws.getRange2("A7").setValue("3");
ws.getRange2("B7").setValue("10");
ws.getRange2("C7").setValue("7");
ws.getRange2("D7").setValue("10");
ws.getRange2("A8").setValue("apples");
ws.getRange2("B8").setValue("oranges");
ws.getRange2("C8").setValue("grapes");
ws.getRange2("D8").setValue("melons");
oParser = new parserFormula("COUNTIF(A7:D7,\"=10\")","A1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 2);
oParser = new parserFormula("COUNTIF(A7:D7,\">5\")","B1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 3);
oParser = new parserFormula("COUNTIF(A7:D7,\"<>10\")","C1",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 2);
oParser = new parserFormula("COUNTIF(A8:D8,\"*es\")","A2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 3);
oParser = new parserFormula("COUNTIF(A8:D8,\"??a*\")","B2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 2);
oParser = new parserFormula("COUNTIF(A8:D8,\"*l*\")","C2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 2);
})
test("Test: \"REPLACE\"",function(){
oParser = new parserFormula("REPLACE(\"abcdefghijk\",3,4,\"XY\")","A2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "abXYghijk");
oParser = new parserFormula("REPLACE(\"abcdefghijk\",3,1,\"12345\")","B2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "ab12345defghijk");
oParser = new parserFormula("REPLACE(\"abcdefghijk\",15,4,\"XY\")","C2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "abcdefghijkXY");
})
test("Test: \"SEARCH\"",function(){
oParser = new parserFormula("SEARCH(\"de\",\"abcdEF\")","A2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 4);
oParser = new parserFormula("SEARCH(\"?c*e\",\"abcdEF\")","B2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 2);
oParser = new parserFormula("SEARCH(\"de\",\"dEFabcdEF\",3)","C2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 7);
oParser = new parserFormula("SEARCH(\"de\",\"dEFabcdEF\",30)","C2",ws);
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), "#VALUE!");
})
......
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