diff options
Diffstat (limited to 'cli/tests/node_compat/test/parallel/test-buffer-bytelength.js')
-rw-r--r-- | cli/tests/node_compat/test/parallel/test-buffer-bytelength.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js b/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js index e23b3c3c2..7fb62c78f 100644 --- a/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js +++ b/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js @@ -2,15 +2,15 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 16.13.0 -// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually +// Taken from Node 18.12.1 +// This file is automatically generated by `tools/node_compat/setup.ts`. Do not modify this file manually. 'use strict'; const common = require('../common'); const assert = require('assert'); const SlowBuffer = require('buffer').SlowBuffer; -const vm = require('vm'); +// const vm = require('vm'); [ [32, 'latin1'], @@ -30,8 +30,6 @@ const vm = require('vm'); ); }); -assert.strictEqual(Buffer.byteLength('', undefined, true), -1); - assert(ArrayBuffer.isView(new Buffer(10))); assert(ArrayBuffer.isView(new SlowBuffer(10))); assert(ArrayBuffer.isView(Buffer.alloc(10))); @@ -98,6 +96,7 @@ assert.strictEqual(Buffer.byteLength('aGkk', 'base64'), 3); assert.strictEqual( Buffer.byteLength('bHNrZGZsa3NqZmtsc2xrZmFqc2RsZmtqcw==', 'base64'), 25 ); +// base64url assert.strictEqual(Buffer.byteLength('aGVsbG8gd29ybGQ', 'base64url'), 11); assert.strictEqual(Buffer.byteLength('aGVsbG8gd29ybGQ', 'BASE64URL'), 11); assert.strictEqual(Buffer.byteLength('bm9kZS5qcyByb2NrcyE', 'base64url'), 14); @@ -128,7 +127,7 @@ assert.strictEqual(Buffer.byteLength('Il était tué', 'utf8'), 14); // TODO(Soremwar) // Enable once vm module is available -// // Test that ArrayBuffer from a different context is detected correctly +// Test that ArrayBuffer from a different context is detected correctly // const arrayBuf = vm.runInNewContext('new ArrayBuffer()'); // assert.strictEqual(Buffer.byteLength(arrayBuf), 0); |