forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbs_map_test.js
98 lines (75 loc) · 1.84 KB
/
bs_map_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
'use strict';
var Mt = require("./mt.js");
var Belt_Array = require("../../lib/js/belt_Array.js");
var Belt_MapInt = require("../../lib/js/belt_MapInt.js");
var Belt_SetInt = require("../../lib/js/belt_SetInt.js");
var suites = {
contents: /* [] */0
};
var test_id = {
contents: 0
};
function eq(loc, x, y) {
test_id.contents = test_id.contents + 1 | 0;
suites.contents = {
hd: [
loc + (" id " + String(test_id.contents)),
(function (param) {
return {
TAG: /* Eq */0,
_0: x,
_1: y
};
})
],
tl: suites.contents
};
}
function b(loc, v) {
test_id.contents = test_id.contents + 1 | 0;
suites.contents = {
hd: [
loc + (" id " + String(test_id.contents)),
(function (param) {
return {
TAG: /* Ok */4,
_0: v
};
})
],
tl: suites.contents
};
}
var mapOfArray = Belt_MapInt.fromArray;
var setOfArray = Belt_SetInt.fromArray;
function emptyMap(param) {
}
var v = Belt_Array.makeByAndShuffle(1000000, (function (i) {
return [
i,
i
];
}));
var u = Belt_MapInt.fromArray(v);
Belt_MapInt.checkInvariantInternal(u);
var firstHalf = Belt_Array.slice(v, 0, 2000);
var xx = Belt_Array.reduce(firstHalf, u, (function (acc, param) {
return Belt_MapInt.remove(acc, param[0]);
}));
Belt_MapInt.checkInvariantInternal(u);
Belt_MapInt.checkInvariantInternal(xx);
Mt.from_pair_suites("Bs_map_test", suites.contents);
var M;
var N;
var A;
exports.suites = suites;
exports.test_id = test_id;
exports.eq = eq;
exports.b = b;
exports.M = M;
exports.N = N;
exports.A = A;
exports.mapOfArray = mapOfArray;
exports.setOfArray = setOfArray;
exports.emptyMap = emptyMap;
/* v Not a pure module */