(input: string | bigint)
| 4 | describe('BigInts', () => { |
| 5 | it(`P.bigint.between(1, 10)`, () => { |
| 6 | const f = (input: string | bigint) => |
| 7 | match(input) |
| 8 | .with(P.bigint.between(0n, 10n), (value) => { |
| 9 | type t = Expect<Equal<typeof value, bigint>>; |
| 10 | return 'between 0 and 10'; |
| 11 | }) |
| 12 | .otherwise((value) => { |
| 13 | type t = Expect<Equal<typeof value, string | bigint>>; |
| 14 | return 'something else'; |
| 15 | }); |
| 16 | |
| 17 | expect(f(5n)).toBe('between 0 and 10'); |
| 18 | expect(f(0n)).toBe('between 0 and 10'); |
no test coverage detected