// Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function get(dict, key) { if (key in dict) { return Primitive_option.some(dict[key]); } } Mocha.describe("Gpr_3154_test", () => { Mocha.test("Dict None value handling", () => { let d = {}; d["foo"] = undefined; let match = get(d, "foo"); if (match !== undefined && Primitive_option.valFromOption(match) === undefined) { return Test_utils.ok("File \"gpr_3154_test.res\", line 16, characters 23-30", true); } else { return Test_utils.ok("File \"gpr_3154_test.res\", line 17, characters 14-21", false); } }); Mocha.test("Dict get with None", () => { let d0 = {}; d0["foo"] = undefined; Test_utils.eq("File \"gpr_3154_test.res\", line 24, characters 7-14", get(d0, "foo"), Primitive_option.some(undefined)); }); }); export { get, } /* Not a pure module */