-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathint_switch_test.js
95 lines (79 loc) · 1.92 KB
/
int_switch_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
// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
var Mt = require("./mt.js");
var Curry = require("../../lib/js/curry.js");
var suites = {
contents: /* [] */0
};
var test_id = {
contents: 0
};
function eq(loc, x, y) {
Mt.eq_suites(test_id, suites, loc, x, y);
}
function b(loc, x) {
Mt.bool_suites(test_id, suites, loc, x);
}
function f(x) {
var match = Curry._1(x, undefined);
switch (match) {
case 1 :
return /* 'a' */97;
case 2 :
return /* 'b' */98;
case 3 :
return /* 'c' */99;
default:
return /* 'x' */120;
}
}
function f22(x) {
var match = Curry._1(x, undefined);
switch (match) {
case 1 :
return /* 'a' */97;
case 2 :
return /* 'b' */98;
case 3 :
return /* 'c' */99;
default:
return /* 'x' */120;
}
}
function f33(x) {
var match = Curry._1(x, undefined);
switch (match) {
case "A" :
return /* 'a' */97;
case "B" :
return /* 'b' */98;
case "C" :
return /* 'c' */99;
case "D" :
return /* 'x' */120;
}
}
eq("File \"int_switch_test.res\", line 32, characters 3-10", f(function (param) {
return 1;
}), /* 'a' */97);
eq("File \"int_switch_test.res\", line 33, characters 3-10", f(function (param) {
return 2;
}), /* 'b' */98);
eq("File \"int_switch_test.res\", line 34, characters 3-10", f(function (param) {
return 3;
}), /* 'c' */99);
eq("File \"int_switch_test.res\", line 35, characters 3-10", f(function (param) {
return 0;
}), /* 'x' */120);
eq("File \"int_switch_test.res\", line 36, characters 3-10", f(function (param) {
return -1;
}), /* 'x' */120);
Mt.from_pair_suites("Int_switch_test", suites.contents);
exports.suites = suites;
exports.test_id = test_id;
exports.eq = eq;
exports.b = b;
exports.f = f;
exports.f22 = f22;
exports.f33 = f33;
/* Not a pure module */