-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlist.test.ts
More file actions
42 lines (30 loc) · 928 Bytes
/
list.test.ts
File metadata and controls
42 lines (30 loc) · 928 Bytes
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
import test from 'ava';
import { Int64 } from './int64.js';
import { List } from './list.js';
test('list', (t) => {
const l = new List(new Int64());
t.deepEqual(l, new List(new Int64()));
l.value = [new Int64(17), new Int64(19), new Int64(null)];
t.is(l.length, 3);
});
test('list equality', (t) => {
const l1 = new List(new Int64());
l1.value = [new Int64(17), new Int64(19), new Int64(null)];
const l2 = new List(new Int64());
l2.value = [new Int64(17), new Int64(19), new Int64(null)];
t.deepEqual(l1, l2);
});
test('list inequality', (t) => {
const l1 = new List(new Int64());
l1.value = new Int64(4);
const l2 = new List(new Int64());
l2.value = new Int64(7);
t.notDeepEqual(l1, l2);
});
test('list equality when invalid', (t) => {
const l1 = new List(new Int64());
l1.value = new Int64();
const l2 = new List(new Int64());
l2.value = new Int64();
t.deepEqual(l1, l2);
});