Skip to content

Commit 968de53

Browse files
committed
🎨 Update
1 parent a5f766e commit 968de53

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/language/list.test.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
prepend,
88
} from "./list.ts";
99

10-
const EXAMPLE_LIST = {
10+
const rest = {
1111
value: 1,
1212
rest: {
1313
value: 2,
@@ -19,35 +19,30 @@ const EXAMPLE_LIST = {
1919
};
2020

2121
Deno.test("[arrayToList]", () => {
22-
assertEquals(arrayToList([1, 2, 3]), EXAMPLE_LIST);
22+
assertEquals(arrayToList([1, 2, 3]), rest);
2323
});
2424

2525
Deno.test("[arrayToListFor]", () => {
26-
assertEquals(arrayToListFor([1, 2, 3]), EXAMPLE_LIST);
26+
assertEquals(arrayToListFor([1, 2, 3]), rest);
2727
});
2828

2929
Deno.test("[arrayToListReduce]", () => {
30-
assertEquals(arrayToListReduce([1, 2, 3]), EXAMPLE_LIST);
30+
assertEquals(arrayToListReduce([1, 2, 3]), rest);
3131
});
3232

3333
Deno.test("[nth]", () => {
34-
const nth3 = nth(EXAMPLE_LIST, 2);
34+
const nth3 = nth(rest, 2);
3535
assertEquals(nth3, 3);
3636

3737
assertThrows(
3838
() => {
39-
nth(EXAMPLE_LIST, 5);
39+
nth(rest, 5);
4040
},
4141
RangeError,
4242
"Index out of range",
4343
);
4444
});
4545

4646
Deno.test("[prepend]", () => {
47-
const prepended = prepend(4, EXAMPLE_LIST);
48-
49-
assertEquals(prepended, {
50-
value: 4,
51-
rest: EXAMPLE_LIST,
52-
});
47+
assertEquals(prepend(4, rest), { value: 4, rest });
5348
});

0 commit comments

Comments
 (0)