forked from puffnfresh/bilby.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathid.js
42 lines (37 loc) · 778 Bytes
/
id.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
var λ = require('./lib/test');
exports.idTest = λ.checkTaggedArgs(
λ.Id,
[λ.AnyVal],
function (id, index) {
return id.value;
}
);
exports.idConcatTest = λ.checkTaggedConcat(
λ.Id,
[String],
function (a, b) {
return λ.concat(a, b);
},
function (id, index) {
return id.value;
}
);
exports.idEmptyTest = function(test) {
test.deepEqual(
λ.empty(λ.idOf(Number)),
λ.empty(λ.idOf(Number))
);
test.done();
};
exports.idMapTest = λ.check(
function(a) {
return λ.equal(λ.Id(a).map(λ.identity).value, a);
},
[λ.AnyVal]
);
exports.idChainTest = λ.check(
function(a) {
return λ.equal(λ.Id(a).chain(λ.identity), a);
},
[λ.AnyVal]
);