Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitryOrlov committed Oct 11, 2023
1 parent bc46889 commit 385a44d
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions tests/cell/spreadsheet-calculation/FormulaTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ $(function () {
});

QUnit.test("Test: \"Parse intersection\"", function (assert) {
ws.getRange2("A1:Z100").cleanAll();

ws.getRange2("A7").setValue("1");
ws.getRange2("A8").setValue("2");
Expand Down Expand Up @@ -13942,6 +13943,8 @@ $(function () {

QUnit.test("Test: \"CONCAT\"", function (assert) {

ws.getRange2("AA1:BB7").cleanAll();

ws.getRange2("AA1").setValue("a1");
ws.getRange2("AA2").setValue("a2");
ws.getRange2("AA4").setValue("a4");
Expand Down Expand Up @@ -13978,6 +13981,9 @@ $(function () {
});

QUnit.test("Test: \"CONCATENATE\"", function (assert) {
wb.dependencyFormulas.unlockRecal();
ws.getRange2("AA1:BB7").cleanAll();
ws.getRange2("A1:Z100").cleanAll();

ws.getRange2("AA2").setValue("brook trout");
ws.getRange2("AA3").setValue("species");
Expand Down Expand Up @@ -14010,25 +14016,26 @@ $(function () {
assert.strictEqual(oParser.calculate().getValue(), "TRUEtest", 'CONCATENATE(TRUE,"test")');

// bug 61293
ws.getRange2("A100").setValue("Val");
ws.getRange2("B100").setValue("=ROUND(0.65,1)");
ws.getRange2("B101").setValue("=ROUND(0.1+0.2,2)");
ws.getRange2("B102").setValue("=ROUND(183.64,2)");
ws.getRange2("A1").setValue("Val");
ws.getRange2("B1").setValue('=ROUND(0.65,1)');
ws.getRange2("B2").setValue('=ROUND(0.1+0.2,2)');
ws.getRange2("B3").setValue('=ROUND(183.64,2)');

oParser = new parserFormula('CONCATENATE(A100," ",B100)', "A2", ws);
assert.ok(oParser.parse(), 'CONCATENATE(Val," ",=ROUND(0.65,1))');
assert.strictEqual(oParser.calculate().getValue(), "Val 0.7", 'CONCATENATE(Val," ",=ROUND(0.65,1))');
oParser = new parserFormula('CONCATENATE(A1," ",B1)', "A2", ws);
assert.ok(oParser.parse(), 'CONCATENATE(Val," ",ROUND(0.65,1))');
assert.strictEqual(oParser.calculate().getValue(), "Val 0.7", 'CONCATENATE(Val," ",ROUND(0.65,1))');

oParser = new parserFormula('CONCATENATE(A100," ",B101)', "A2", ws);
assert.ok(oParser.parse(), 'CONCATENATE(Val," ",=ROUND(0.1+0.2,2))');
assert.strictEqual(oParser.calculate().getValue(), "Val 0.3", 'CONCATENATE(Val," ",=ROUND(0.1+0.2,2))');

oParser = new parserFormula('CONCATENATE(A100," ",B102)', "A2", ws);
assert.ok(oParser.parse(), 'CONCATENATE(Val," ",=ROUND(183.64,2))');
assert.strictEqual(oParser.calculate().getValue(), "Val 183.64", 'CONCATENATE(Val," ",=ROUND(183.64,2))');
oParser = new parserFormula('CONCATENATE(A1," ",B2)', "A2", ws);
assert.ok(oParser.parse(), 'CONCATENATE(Val," ",ROUND(0.1+0.2,2))');
assert.strictEqual(oParser.calculate().getValue(), "Val 0.3", 'CONCATENATE(Val," ",ROUND(0.1+0.2,2))');

oParser = new parserFormula('CONCATENATE(A1," ",B3)', "A2", ws);
assert.ok(oParser.parse(), 'CONCATENATE(Val," ",ROUND(183.64,2))');
assert.strictEqual(oParser.calculate().getValue(), "Val 183.64", 'CONCATENATE(Val," ",ROUND(183.64,2))');

testArrayFormula2(assert, "CONCATENATE", 1, 8);

wb.dependencyFormulas.lockRecal();
});

QUnit.test("Test: \"&\"", function (assert) {
Expand Down

0 comments on commit 385a44d

Please sign in to comment.