Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/parallel/test-buffer-alloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
expected.replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')
);

base64flavors.forEach((encoding) => {

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / aarch64-darwin: with shared libraries / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /Users/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/Users/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /Users/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / x86_64-linux: with shared libraries and perfetto / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / x86_64-darwin: with shared libraries / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /Users/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/Users/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /Users/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-4.1.0 / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-fips-4.1.0 / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-3.0.22 / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared boringssl-0.20261105.0 / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js

Check failure on line 374 in test/parallel/test-buffer-alloc.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-3.5.9 / build

--- stderr --- node:internal/assert/utils:146 throw error; ^ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 269 !== 90 at /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:418:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js:374:17) at Module._compile (node:internal/modules/cjs/loader:1979:14) at Object..js (node:internal/modules/cjs/loader:2119:10) at Module.load (node:internal/modules/cjs/loader:1701:32) at Module._load (node:internal/modules/cjs/loader:1491:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5) at node:internal/main/run_main_module:33:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: 269, expected: 90, operator: 'strictEqual', diff: 'simple' } Node.js v28.0.0-pre Command: out/Release/node /home/runner/work/_temp/node-v28.0.0-nightly2026-11-26a0cb87bd9c-slim/test/parallel/test-buffer-alloc.js
let b = Buffer.allocUnsafe(1024);
let bytesWritten = b.write(expected, 0, encoding);
assert.strictEqual(quote.length, bytesWritten);
Expand Down Expand Up @@ -405,6 +405,18 @@
b = Buffer.from(expectedIllegal, encoding);
assert.strictEqual(quote.length, b.length);
assert.strictEqual(quote, b.toString('ascii', 0, quote.length));

// Check that the base64 decoder ignores illegal chars in two-byte
// strings, including ones whose low byte is a base64 char or '='.
const expectedTwoByte = expected.slice(0, 60) + '\u4e2d' +
expected.slice(60, 120) + '\u013d' +
expected.slice(120, 180) + '\u0141' +
expected.slice(180, 240) + '\u4e2d'.repeat(4) +
expected.slice(240, 300) + '\u{1f600}' +
expected.slice(300, 360);
b = Buffer.from(expectedTwoByte, encoding);
assert.strictEqual(quote.length, b.length);
assert.strictEqual(quote, b.toString('ascii', 0, quote.length));
});
}

Expand Down Expand Up @@ -655,6 +667,11 @@
// Test that if a trailing character is discarded, rest of string is processed.
assert.deepStrictEqual(Buffer.from('Abx', 'hex'), Buffer.from('Ab', 'hex'));

// Test that non-Latin1 characters whose low byte is a hex digit are rejected.
assert.strictEqual(Buffer.from('\u0141\u0141', 'hex').length, 0);
assert.deepStrictEqual(Buffer.from('Ab\u0141\u0141', 'hex'),
Buffer.from('Ab', 'hex'));

// Test single base64 char encodes as 0.
assert.strictEqual(Buffer.from('A', 'base64').length, 0);

Expand Down
Loading