MCPcopy Create free account
hub / github.com/nodejs/node / validateZeroByteLiar

Function validateZeroByteLiar

test/parallel/test-fs-promises-readfile.js:72–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70}
71
72async function validateZeroByteLiar() {
73 const originalFStat = fsBinding.fstat;
74 fsBinding.fstat = common.mustCall(
75 async () => (/* stat fields */ [0, 1, 2, 3, 4, 5, 6, 7, 0 /* size */])
76 );
77 const readBuffer = await readFile(fn);
78 assert.strictEqual(readBuffer.toString(), largeBuffer.toString());
79 fsBinding.fstat = originalFStat;
80}
81
82(async () => {
83 await createLargeFile();

Callers 1

Calls 2

readFileFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected