name:
src/test/js/execution/CodeExecutorGeneralFormulaTest.ts
-rw-r--r--
769
1import { assert } from "chai";
2import { it, describe } from "../testutils/TestUtils";
3import { run } from "../testutils/TestUtils";
4
5describe("CodeExecutor - General Formula Test", function () {
6 it("should work without arguments", function () {
7 assert.equal(run("TRUE()"), true);
8 assert.equal(run("FALSE()"), false);
9 });
10
11 it("should work with number arguments", function () {
12 assert.equal(run("ADD(3, 4)"), 7);
13 });
14
15 it("should work with string arguments", function () {
16 assert.equal(run('ADD("3", "4")'), 7);
17 });
18
19 it("should work with boolean arguments", function () {
20 assert.equal(run("ADD(TRUE, TRUE)"), 2);
21 });
22
23 it("should work with array literal arguments", function () {
24 assert.equal(run("ADD({44}, {1})"), 45);
25 });
26});