-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.ts
36 lines (34 loc) · 976 Bytes
/
test.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
import type { Address, PresentDeliveryList } from './solution';
import { Expect, Equal } from 'type-testing';
type MixedBehaviorList = {
john: { behavior: 'good' };
jimmy: { behavior: 'bad' };
sara: { behavior: 'good' };
suzy: { behavior: 'good' };
chris: { behavior: 'good' };
penny: { behavior: 'bad' };
};
type test_MixedBehaviorTest_actual = PresentDeliveryList<MixedBehaviorList>;
// ^?
type test_MixedBehaviorTest_expected = {
john: Address;
jimmy: Address;
sara: Address;
suzy: Address;
chris: Address;
penny: Address;
};
type test_MixedBehaviorTest = Expect<
Equal<test_MixedBehaviorTest_actual, test_MixedBehaviorTest_expected>
>;
type Unrelated = {
hello: { hello: 'hello' };
world: { world: 'world' };
};
type test_Unrelated_actual = PresentDeliveryList<Unrelated>;
// ^?
type test_Unrelated_expected = {
hello: Address;
world: Address;
};
type test_Unrelated = Expect<Equal<test_Unrelated_actual, test_Unrelated_expected>>;