MCPcopy Create free account
hub / github.com/denoland/std / check

Function check

io/buffer_test.ts:29–36  ·  view source on GitHub ↗
(buf: Buffer, s: string)

Source from the content-addressed store, hash-verified

27}
28
29function 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;

Callers 3

fillBytesFunction · 0.70
emptyFunction · 0.70
buffer_test.tsFile · 0.70

Calls 2

assertEqualsFunction · 0.90
bytesMethod · 0.45

Tested by

no test coverage detected