// Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; Mocha.describe("Equal_exception_test", () => { Mocha.test("exception", () => { try { throw { RE_EXN_ID: "Not_found", Error: new Error() }; } catch (raw_exn) { let exn = Primitive_exceptions.internalToException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return; } throw exn; } }); Mocha.test(" is_normal_exception", () => { let A = /* @__PURE__ */Primitive_exceptions.create("A"); let v = { RE_EXN_ID: A, _1: 3 }; try { throw v; } catch (raw_exn) { let exn = Primitive_exceptions.internalToException(raw_exn); if (exn.RE_EXN_ID === A) { if (exn._1 === 3) { return; } throw exn; } throw exn; } }); Mocha.test("is_arbitrary_exception", () => { let A = /* @__PURE__ */Primitive_exceptions.create("A"); try { throw { RE_EXN_ID: A, Error: new Error() }; } catch (exn) { return; } }); }); let e = { RE_EXN_ID: "Not_found" }; function eq(x) { return x.RE_EXN_ID === "Not_found"; } let Not_found = /* @__PURE__ */Primitive_exceptions.create("Equal_exception_test.Not_found"); if (Primitive_object.equal(e, { RE_EXN_ID: Not_found }) !== false) { throw { RE_EXN_ID: "Assert_failure", _1: [ "equal_exception_test.res", 40, 0 ], Error: new Error() }; } if (Not_found === "Not_found" !== false) { throw { RE_EXN_ID: "Assert_failure", _1: [ "equal_exception_test.res", 41, 0 ], Error: new Error() }; } export { e, eq, Not_found, } /* Not a pure module */