(expected: Optional<string>, input: string[], value: string | null)
| 7 | |
| 8 | UnitTest.test('api.PositionArray.find', () => { |
| 9 | const check = (expected: Optional<string>, input: string[], value: string | null) => { |
| 10 | const pred = (unit: Parrays.PArrayTestItem) => { |
| 11 | return unit.item === value; |
| 12 | }; |
| 13 | |
| 14 | const parray = Parrays.make(input); |
| 15 | const actual = PositionArray.find(parray, pred); |
| 16 | KAssert.eqOptional('eq', expected, actual.map((x) => x.item)); |
| 17 | }; |
| 18 | |
| 19 | check(Optional.none(), [], null); |
| 20 | check(Optional.some('a'), [ 'a' ], 'a'); |
no test coverage detected
searching dependent graphs…