Overview of node:buffer granular parity suite
mainThe node:buffer granular parity suite is a collection of focused Node.js parity test cases designed to validate Perry's node:buffer compatibility layer. The suite ensures that Perry's implementation of the Buffer API behaves identically to Node.js and Deno by using small, deterministic TypeScript programs to isolate failures to specific API families.
Key areas of coverage include:
- Encoding & Decoding:
base64urldecoding, base64 implicit-padding decoding, and encoding-awarebyteLength(including astral-char regression handling forascii,latin1, andbinaryto match Node's UTF-16 code unit behavior). - Buffer Creation & Allocation:
Buffer.of,Buffer.from(arrayBuffer, byteOffset, length?)range selection, and large-bufferallocUnsafe/allocUnsafeSlowlength parity. - Numeric & Array Handling: Numeric slice coercion, bad hex truncation, Buffer iteration, and numeric byte wrapping (e.g.,
-1wrapping toff). - Data Integrity: Signed 64-bit endian round-trips.