-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathOptionTests.mjs
77 lines (67 loc) · 1.48 KB
/
OptionTests.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
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
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as Test from "./Test.mjs";
import * as Caml_obj from "rescript/lib/es6/caml_obj.js";
import * as Core__Option from "../src/Core__Option.mjs";
var eq = Caml_obj.equal;
function isPositive(i) {
return i > 0;
}
Test.run([
[
"OptionTests.res",
12,
13,
47
],
"isSomeAnd: if None, return false"
], Core__Option.isSomeAnd(undefined, isPositive), eq, false);
Test.run([
[
"OptionTests.res",
19,
13,
55
],
"isSomeAnd: if Some and true, return true"
], Core__Option.isSomeAnd(1, isPositive), eq, true);
Test.run([
[
"OptionTests.res",
25,
13,
57
],
"isSomeAnd: if Some and false, return false"
], Core__Option.isSomeAnd(-1, isPositive), eq, false);
Test.run([
[
"OptionTests.res",
31,
20,
52
],
"isNoneOr: if None, return true"
], Core__Option.isNoneOr(undefined, isPositive), eq, true);
Test.run([
[
"OptionTests.res",
33,
13,
54
],
"isNoneOr: if Some and true, return true"
], Core__Option.isNoneOr(1, isPositive), eq, true);
Test.run([
[
"OptionTests.res",
39,
13,
56
],
"isNoneOr: if Some and false, return false"
], Core__Option.isNoneOr(-1, isPositive), eq, false);
export {
eq ,
isPositive ,
}
/* Not a pure module */