forked from rescript-lang/rescript-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrorTests.mjs
39 lines (35 loc) · 888 Bytes
/
ErrorTests.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as Test from "./Test.mjs";
import * as Js_exn from "rescript/lib/es6/js_exn.js";
import * as RescriptCore from "../src/RescriptCore.mjs";
import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
function panicTest(param) {
var caught;
try {
caught = RescriptCore.panic("uh oh");
}
catch (raw_err){
var err = Caml_js_exceptions.internalToOCamlException(raw_err);
if (err.RE_EXN_ID === Js_exn.$$Error) {
caught = err._1.message;
} else {
throw err;
}
}
Test.run([
[
"ErrorTests.res",
8,
22,
43
],
"Should resolve test"
], caught, (function (prim0, prim1) {
return prim0 === prim1;
}), "Panic! uh oh");
}
panicTest(undefined);
export {
panicTest ,
}
/* Not a pure module */