forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathequal_exception_test.js
168 lines (158 loc) · 2.67 KB
/
equal_exception_test.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// Generated CODE, PLEASE EDIT WITH CARE
"use strict";
var Bytes = require("../stdlib/bytes");
var Caml_exceptions = require("../runtime/caml_exceptions");
var Mt = require("./mt");
var v = "gso";
function is_equal() {
if (Bytes.make(3, /* "a" */97)[0] !== /* "a" */97) {
throw [
0,
Caml_exceptions.Assert_failure,
[
0,
"equal_exception_test.ml",
9,
4
]
];
}
if (Bytes.make(3, /* "a" */97)[0] !== /* "a" */97) {
throw [
0,
Caml_exceptions.Assert_failure,
[
0,
"equal_exception_test.ml",
10,
4
]
];
}
var u = Bytes.make(3, /* "a" */97);
u[0] = /* "b" */98;
if (u[0] !== /* "b" */98) {
throw [
0,
Caml_exceptions.Assert_failure,
[
0,
"equal_exception_test.ml",
13,
4
]
];
}
if (v[0] === "g") {
return 0;
}
else {
throw [
0,
Caml_exceptions.Assert_failure,
[
0,
"equal_exception_test.ml",
14,
4
]
];
}
}
function is_exception() {
try {
throw Caml_exceptions.Not_found;
}
catch (exn){
if (exn === Caml_exceptions.Not_found) {
return /* () */0;
}
else {
throw exn;
}
}
}
function is_normal_exception() {
var A = [
248,
"A",
++ Caml_exceptions.caml_oo_last_id
];
var v = [
0,
A,
3
];
try {
throw v;
}
catch (exn){
if (exn[1] === A) {
if (exn[2] !== 3) {
throw exn;
}
else {
return /* () */0;
}
}
else {
throw exn;
}
}
}
function is_arbitrary_exception() {
var A = [
248,
"A",
++ Caml_exceptions.caml_oo_last_id
];
try {
throw A;
}
catch (exn){
return /* () */0;
}
}
var suites_001 = [
/* tuple */0,
"is_equal",
is_equal
];
var suites_002 = [
/* :: */0,
[
/* tuple */0,
"is_exception",
is_exception
],
[
/* :: */0,
[
/* tuple */0,
"is_normal_exception",
is_normal_exception
],
[
/* :: */0,
[
/* tuple */0,
"is_arbitrary_exception",
is_arbitrary_exception
],
/* [] */0
]
]
];
var suites = [
/* :: */0,
suites_001,
suites_002
];
Mt.from_suites("exception", suites);
exports.v = v;
exports.is_equal = is_equal;
exports.is_exception = is_exception;
exports.is_normal_exception = is_normal_exception;
exports.is_arbitrary_exception = is_arbitrary_exception;
exports.suites = suites;
/* Not a pure module */