forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpr_2503_test.js
109 lines (88 loc) · 2.62 KB
/
gpr_2503_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
'use strict';
var Mt = require("./mt.js");
var Caml_option = require("../../lib/js/caml_option.js");
var suites = /* record */[/* contents : [] */0];
var test_id = /* record */[/* contents */0];
function eq(loc, x, y) {
return Mt.eq_suites(test_id, suites, loc, x, y);
}
function b(loc, b$1) {
return Mt.bool_suites(test_id, suites, loc, b$1);
}
function makeWrapper(foo, param) {
var tmp = { };
if (foo !== undefined) {
tmp.foo = (function () {
switch (Caml_option.valFromOption(foo)) {
case 97 :
return "a";
case 98 :
return "b";
}
})();
}
console.log(tmp);
return /* () */0;
}
function makeWrapper2(foo, param) {
console.log({
foo: (function () {
switch (foo) {
case 97 :
return "a";
case 98 :
return "b";
}
})()
});
return /* () */0;
}
makeWrapper2(/* a */97, /* () */0);
function makeWrapper3(foo, param) {
console.log(2);
var tmp = { };
if (foo !== undefined) {
tmp.foo = (function () {
switch (Caml_option.valFromOption(foo)) {
case 97 :
return "a";
case 98 :
return "b";
}
})();
}
return tmp;
}
function makeWrapper4(foo, param) {
console.log(2);
var tmp = { };
var tmp$1 = foo > 100 ? undefined : (
foo > 10 ? /* b */98 : /* a */97
);
if (tmp$1 !== undefined) {
tmp.foo = (function () {
switch (Caml_option.valFromOption(tmp$1)) {
case 97 :
return "a";
case 98 :
return "b";
}
})();
}
return tmp;
}
b("File \"test/gpr_2503_test.ml\", line 31, characters 5-12", "a" === makeWrapper3(/* a */97, /* () */0).foo);
b("File \"test/gpr_2503_test.ml\", line 34, characters 5-12", undefined === makeWrapper3(undefined, /* () */0).foo);
b("File \"test/gpr_2503_test.ml\", line 37, characters 5-12", "a" === makeWrapper4(1, /* () */0).foo);
b("File \"test/gpr_2503_test.ml\", line 40, characters 5-12", "b" === makeWrapper4(11, /* () */0).foo);
b("File \"test/gpr_2503_test.ml\", line 43, characters 5-12", undefined === makeWrapper4(111, /* () */0).foo);
Mt.from_pair_suites("Gpr_2503_test", suites[0]);
exports.suites = suites;
exports.test_id = test_id;
exports.eq = eq;
exports.b = b;
exports.makeWrapper = makeWrapper;
exports.makeWrapper2 = makeWrapper2;
exports.makeWrapper3 = makeWrapper3;
exports.makeWrapper4 = makeWrapper4;
/* Not a pure module */