(A: Schema.Schema.Any, B: Schema.Schema.Any, expected: readonly [string, string], options?: {
readonly skipFastCheck?: boolean | undefined
})
| 7 | import * as Util from "../TestUtils.js" |
| 8 | |
| 9 | const assertExtend = (A: Schema.Schema.Any, B: Schema.Schema.Any, expected: readonly [string, string], options?: { |
| 10 | readonly skipFastCheck?: boolean | undefined |
| 11 | }) => { |
| 12 | const AB = Schema.extend(A, B) |
| 13 | const BA = Schema.extend(B, A) |
| 14 | strictEqual(String(AB), expected[0], "AB") |
| 15 | strictEqual(String(BA), expected[1], "BA") |
| 16 | const arbAB = Arbitrary.make(AB) |
| 17 | const arbBA = Arbitrary.make(BA) |
| 18 | const isAB = Schema.is(AB) |
| 19 | const isBA = Schema.is(BA) |
| 20 | if (options?.skipFastCheck) { |
| 21 | return |
| 22 | } |
| 23 | FastCheck.assert( |
| 24 | FastCheck.property(arbAB, (ab) => isBA(ab)), |
| 25 | { numRuns: 10 } |
| 26 | ) |
| 27 | FastCheck.assert( |
| 28 | FastCheck.property(arbBA, (ba) => isAB(ba)), |
| 29 | { numRuns: 10 } |
| 30 | ) |
| 31 | } |
| 32 | |
| 33 | describe("extend", () => { |
| 34 | describe("String", () => { |
no test coverage detected