// Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; function floatFromLeft(x) { return 1.5 + x; } function stringFromLeft(x) { return "a" + x; } function floatFromRight(x) { return x + 2.5; } function bigintFromRight(x) { return x + 2n; } function intByDefault(x, y) { return x + y | 0; } function intInBranch(w, x) { return 1 + x | 0; } function nestedFloat(x) { return 1.5 + (x + (x + 0.5)); } function nestedFromRight(x) { return x - (x - 1.5); } Mocha.describe("Unified_ops_operand_test", () => { Mocha.test("the type comes from the left operand", () => { Test_utils.eq("File \"unified_ops_operand_test.res\", line 36, characters 7-14", 1.5 + 1.0, 2.5); Test_utils.eq("File \"unified_ops_operand_test.res\", line 37, characters 7-14", "ab", "ab"); }); Mocha.test("the type comes from the right operand", () => { Test_utils.eq("File \"unified_ops_operand_test.res\", line 41, characters 7-14", 1.0 + 2.5, 3.5); Test_utils.eq("File \"unified_ops_operand_test.res\", line 42, characters 7-14", 1n + 2n, 3n); }); Mocha.test("without a known type the operator is on ints", () => Test_utils.eq("File \"unified_ops_operand_test.res\", line 46, characters 7-14", 3, 3)); Mocha.test("an operand whose type is int only in a GADT branch", () => Test_utils.eq("File \"unified_ops_operand_test.res\", line 50, characters 7-14", 3, 3)); Mocha.test("nested operands", () => { Test_utils.eq("File \"unified_ops_operand_test.res\", line 54, characters 7-14", 1.5 + (1.0 + (1.0 + 0.5)), 4.0); Test_utils.eq("File \"unified_ops_operand_test.res\", line 55, characters 7-14", 2.0 - (2.0 - 1.5), 1.5); }); }); export { floatFromLeft, stringFromLeft, floatFromRight, bigintFromRight, intByDefault, intInBranch, nestedFloat, nestedFromRight, } /* Not a pure module */