(tag: string, run: () => unknown, message?: string)
| 17 | } |
| 18 | |
| 19 | const assertThrowsTagged = (tag: string, run: () => unknown, message?: string): void => { |
| 20 | try { |
| 21 | run() |
| 22 | } catch (error) { |
| 23 | assert.strictEqual((error as { readonly _tag?: string })._tag, tag) |
| 24 | if (message !== undefined) assert.strictEqual((error as Error).message, message) |
| 25 | return |
| 26 | } |
| 27 | assert.fail(`Expected ${tag}`) |
| 28 | } |
| 29 | |
| 30 | const assertParseFailure = (golden: string): void => |
| 31 | assertThrowsTagged("PgProtocolParseError", () => PgProtocol.makeParser().push(bytes(golden))) |
no test coverage detected