MCPcopy Create free account
hub / github.com/awslabs/llrt / testEnd

Function testEnd

tests/unit/string_decoder.test.ts:209–223  ·  view source on GitHub ↗
(
    encoding: BufferEncoding,
    incomplete: Uint8Array,
    next: Uint8Array,
    expected: string
  )

Source from the content-addressed store, hash-verified

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) => {

Callers 1

Calls 2

writeMethod · 0.95
endMethod · 0.95

Tested by

no test coverage detected