generated from garronej/ts-ci
-
Notifications
You must be signed in to change notification settings - Fork 6
/
exclude.ts
43 lines (27 loc) 路 839 Bytes
/
exclude.ts
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
import { exclude } from "../exclude.ts";
import { assert } from "../assert.ts";
import { same } from "https://raw.githubusercontent.com/garronej/evt/v2.3.0/deno_dist/tools/inDepth/same.ts";
{
const got = ["a", "b", "c"].filter(exclude("a"));
const expected = ["b", "c"];
assert(same(got, expected));
console.log("PASS TEST 1");
}
{
const got = ["a", "b", "c"].filter(exclude(["a"]));
const expected = ["b", "c"];
assert(same(got, expected));
console.log("PASS TEST 2");
}
{
const got = [1, 2, 3].filter(exclude("foo"));
const expected = [1, 2, 3];
assert(same(got, expected));
console.log("PASS TEST 3");
}
{
const got = ["a", "b", "c", "d"].filter(exclude(["a", "b"]));
const expected = ["c", "d"];
assert(same(got, expected));
console.log("PASS TEST 4");
}