(
test: (c: string) => boolean,
param: AbiParam,
expectMessage: string,
)
| 50 | } |
| 51 | |
| 52 | expectIf( |
| 53 | test: (c: string) => boolean, |
| 54 | param: AbiParam, |
| 55 | expectMessage: string, |
| 56 | ): string { |
| 57 | const passed = this.passWhile(test) |
| 58 | |
| 59 | if (passed !== undefined) { |
| 60 | return passed |
| 61 | } |
| 62 | throw this.error( |
| 63 | `Param ${param.name} (${param.type}) expect ${expectMessage}`, |
| 64 | ) |
| 65 | } |
| 66 | |
| 67 | expect(test: string, param: AbiParam): string { |
| 68 | return this.expectIf(x => x === test, param, `"${test}"`) |
no test coverage detected