(input: Option<number>)
| 5 | describe('Multiple patterns', () => { |
| 6 | it('should match if one of the patterns matches', () => { |
| 7 | const testFn = (input: Option<number>) => |
| 8 | match(input) |
| 9 | .with( |
| 10 | { kind: 'some', value: 2 as const }, |
| 11 | { kind: 'some', value: 3 as const }, |
| 12 | { kind: 'some', value: 4 as const }, |
| 13 | (x) => { |
| 14 | type t = Expect< |
| 15 | Equal< |
| 16 | typeof x, |
| 17 | | { kind: 'some'; value: 2 } |
| 18 | | { kind: 'some'; value: 3 } |
| 19 | | { kind: 'some'; value: 4 } |
| 20 | > |
| 21 | >; |
| 22 | return true; |
| 23 | } |
| 24 | ) |
| 25 | .with({ kind: 'none' }, { kind: 'some' }, (x) => { |
| 26 | type t = Expect< |
| 27 | Equal<typeof x, { kind: 'some'; value: number } | { kind: 'none' }> |
| 28 | >; |
| 29 | return false; |
| 30 | }) |
| 31 | .run(); |
| 32 | |
| 33 | const cases = [ |
| 34 | { input: { kind: 'some', value: 3 }, expected: true }, |
no test coverage detected
searching dependent graphs…