(
encoding: BufferEncoding,
incomplete: Uint8Array,
next: Uint8Array,
expected: string
)
| 207 | const bufs = ["☃💩", "asdf"].map((b) => Buffer.from(b)); |
| 208 | |
| 209 | function testEnd( |
| 210 | encoding: BufferEncoding, |
| 211 | incomplete: Uint8Array, |
| 212 | next: Uint8Array, |
| 213 | expected: string |
| 214 | ) { |
| 215 | let res = ""; |
| 216 | const s = new StringDecoder(encoding); |
| 217 | res += s.write(incomplete); |
| 218 | res += s.end(); |
| 219 | res += s.write(next); |
| 220 | res += s.end(); |
| 221 | |
| 222 | expect(res).toEqual(expected); |
| 223 | } |
| 224 | |
| 225 | function testEncoding(encoding: BufferEncoding) { |
| 226 | bufs.forEach((buf) => { |
no test coverage detected