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

Function fn

io/buffer_test.ts:171–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169 name: "Buffer.writeSync() grows buffer to max capacity",
170 ignore: ignoreMaxSizeTests,
171 fn() {
172 const bufSize = 16 * 1024;
173 const capacities = [MAX_SIZE, MAX_SIZE - 1];
174 for (const capacity of capacities) {
175 let written = 0;
176 const buf = new Buffer();
177 const writes = Math.floor(capacity / bufSize);
178 for (let i = 0; i < writes; i++) {
179 written += buf.writeSync(repeat("x", bufSize));
180 }
181
182 if (written < capacity) {
183 written += buf.writeSync(repeat("x", capacity - written));
184 }
185
186 assertEquals(written, capacity);
187 }
188 },
189});
190
191Deno.test({

Callers

nothing calls this directly

Calls 9

writeSyncMethod · 0.95
readFromMethod · 0.95
readFromSyncMethod · 0.95
growMethod · 0.95
assertEqualsFunction · 0.90
assertRejectsFunction · 0.90
assertThrowsFunction · 0.90
floorMethod · 0.80
repeatFunction · 0.70

Tested by

no test coverage detected