-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday03.ts
44 lines (38 loc) · 967 Bytes
/
day03.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
44
import { Equal, Expect } from "../../testing-types";
/* Solution */
type GiftWrapper<Present, From, To> = {
present: Present;
from: From;
to: To;
};
/* Tests */
type test_SantaToTrash_actual = GiftWrapper<"Car", "Santa", "Trash">;
// ^?
type test_SantaToTrash_expected = {
present: "Car";
from: "Santa";
to: "Trash";
};
type test_SantaToTrash = Expect<
Equal<test_SantaToTrash_actual, test_SantaToTrash_expected>
>;
type test_TrashToPrime_actual = GiftWrapper<"vscode", "Trash", "Prime">;
// ^?
type test_TrashToPrime_expected = {
present: "vscode";
from: "Trash";
to: "Prime";
};
type test_TrashToPrime = Expect<
Equal<test_TrashToPrime_actual, test_TrashToPrime_expected>
>;
type test_DanToEvan_actual = GiftWrapper<"javascript", "Dan", "Evan">;
// ^?
type test_DanToEvan_expected = {
present: "javascript";
from: "Dan";
to: "Evan";
};
type test_DanToEvan = Expect<
Equal<test_DanToEvan_actual, test_DanToEvan_expected>
>;