f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/test/js/execution/ExecutorSupportedLogicFormulasTest.ts
-rw-r--r--
2621
 1import { runner, it, describe } from "../testutils/TestUtils";
 2
 3describe("Executor.execute - Logic Formulas", function () {
 4  it("should support AND", function () {
 5    runner().addCell("Alpha", "A1", "=AND(TRUE, TRUE)").addExpectedValue("Alpha", "A1", true).run();
 6  });
 7
 8  it("should support EQ", function () {
 9    runner()
10      .addCell("Alpha", "A1", "=EQ(10, 298132.222)")
11      .addExpectedValue("Alpha", "A1", false)
12      .run();
13  });
14
15  it("should support EXACT", function () {
16    runner().addCell("Alpha", "A1", '=EXACT("A", "A")').addExpectedValue("Alpha", "A1", true).run();
17  });
18
19  it("should support FALSE", function () {
20    runner().addCell("Alpha", "A1", "=FALSE()").addExpectedValue("Alpha", "A1", false).run();
21  });
22
23  it("should support GTE", function () {
24    runner()
25      .addCell("Alpha", "A1", "=GTE(10.4, 0.11111)")
26      .addExpectedValue("Alpha", "A1", true)
27      .run();
28  });
29
30  it("should support GT", function () {
31    runner()
32      .addCell("Alpha", "A1", "=GT(10.4, 0.11111)")
33      .addExpectedValue("Alpha", "A1", true)
34      .run();
35  });
36
37  it("should support IF", function () {
38    runner().addCell("Alpha", "A1", "=IF(true, 1, 0)").addExpectedValue("Alpha", "A1", 1).run();
39  });
40
41  it("should support IFERROR", function () {
42    runner().addCell("Alpha", "A1", "=IFERROR(#NULL!, 1)").addExpectedValue("Alpha", "A1", 1).run();
43  });
44
45  it("should support IFNA", function () {
46    runner().addCell("Alpha", "A1", "=IFNA(#N/A, 1)").addExpectedValue("Alpha", "A1", 1).run();
47  });
48
49  it("should support LTE", function () {
50    runner()
51      .addCell("Alpha", "A1", "=LTE(10.4, 0.11111)")
52      .addExpectedValue("Alpha", "A1", false)
53      .run();
54  });
55
56  it("should support LT", function () {
57    runner()
58      .addCell("Alpha", "A1", "=LT(10.4, 0.11111)")
59      .addExpectedValue("Alpha", "A1", false)
60      .run();
61  });
62
63  it("should support NE", function () {
64    runner()
65      .addCell("Alpha", "A1", "=NE(10.4, 0.11111)")
66      .addExpectedValue("Alpha", "A1", true)
67      .run();
68  });
69
70  it("should support NOT", function () {
71    runner().addCell("Alpha", "A1", "=NOT(false)").addExpectedValue("Alpha", "A1", true).run();
72  });
73
74  it("should support OR", function () {
75    runner().addCell("Alpha", "A1", "=OR(0, 0, 1)").addExpectedValue("Alpha", "A1", true).run();
76  });
77
78  it("should support OR", function () {
79    runner().addCell("Alpha", "A1", "=XOR(0, 0, 1)").addExpectedValue("Alpha", "A1", true).run();
80  });
81
82  it("should support TRUE", function () {
83    runner().addCell("Alpha", "A1", "=TRUE()").addExpectedValue("Alpha", "A1", true).run();
84  });
85});