(buf: Buffer, s: string)
| 27 | } |
| 28 | |
| 29 | function check(buf: Buffer, s: string) { |
| 30 | const bytes = buf.bytes(); |
| 31 | assertEquals(buf.length, bytes.byteLength); |
| 32 | const decoder = new TextDecoder(); |
| 33 | const bytesStr = decoder.decode(bytes); |
| 34 | assertEquals(bytesStr, s); |
| 35 | assertEquals(buf.length, s.length); |
| 36 | } |
| 37 | |
| 38 | // Fill buf through n writes of byte slice fub. |
| 39 | // The initial contents of buf corresponds to the string s; |
no test coverage detected