( buf: Buffer, s: string, fub: Uint8Array, )
| 58 | // Empty buf through repeated reads into fub. |
| 59 | // The initial contents of buf corresponds to the string s. |
| 60 | async function empty( |
| 61 | buf: Buffer, |
| 62 | s: string, |
| 63 | fub: Uint8Array, |
| 64 | ) { |
| 65 | check(buf, s); |
| 66 | while (true) { |
| 67 | const r = await buf.read(fub); |
| 68 | if (r === null) { |
| 69 | break; |
| 70 | } |
| 71 | s = s.slice(r); |
| 72 | check(buf, s); |
| 73 | } |
| 74 | check(buf, ""); |
| 75 | } |
| 76 | |
| 77 | function repeat(c: string, bytes: number): Uint8Array { |
| 78 | assertEquals(c.length, 1); |
no test coverage detected