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
|
// |reftest| skip-if(!this.hasOwnProperty("Tuple"))
let tup = #[1, 2, 3];
assertEq(tup.length, 3);
assertEq(tup[0], 1);
assertEq(tup[1], 2);
assertEq(tup[2], 3);
let arr = [3, 4, 5];
tup = #[1, 2, ...arr, 6, ...arr];
assertEq(tup.length, 9);
assertEq(tup[0], 1);
assertEq(tup[1], 2);
assertEq(tup[2], 3);
assertEq(tup[3], 4);
assertEq(tup[4], 5);
assertEq(tup[5], 6);
assertEq(tup[6], 3);
assertEq(tup[7], 4);
assertEq(tup[8], 5);
tup = #[(() => 1)()];
assertEq(tup.length, 1);
assertEq(tup[0], 1);
tup = #[];
assertEq(tup.length, 0);
if (typeof reportCompare === "function") reportCompare(0, 0);
|