From eedd380ce8ca312721aad3aefdb7d786cf161956 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 16 Feb 2018 01:12:49 -0800 Subject: [PATCH] Skip destructive test-buffer-inspect.js test --- bin/download-node-tests.js | 5 +++- test/node/test-buffer-inspect.js | 41 -------------------------------- 2 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 test/node/test-buffer-inspect.js diff --git a/bin/download-node-tests.js b/bin/download-node-tests.js index 8b08fc3..c05a98e 100755 --- a/bin/download-node-tests.js +++ b/bin/download-node-tests.js @@ -46,7 +46,10 @@ function downloadBufferTests (dir, files) { // disabled in all browsers due to the Spectre/Meltdown security issue. 'test-buffer-sharedarraybuffer.js', // References Node.js internals, irrelevant to browser implementation - 'test-buffer-bindingobj-no-zerofill.js' + 'test-buffer-bindingobj-no-zerofill.js', + // Destructive test, modifies buffer.INSPECT_MAX_BYTES and causes later tests + // to fail. + 'test-buffer-inspect.js' ] // Skip test files with these names diff --git a/test/node/test-buffer-inspect.js b/test/node/test-buffer-inspect.js deleted file mode 100644 index d0ed590..0000000 --- a/test/node/test-buffer-inspect.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; -var Buffer = require('../../').Buffer; - - -var assert = require('assert'); - -var util = require('util'); - -var buffer = require('../../'); - -buffer.INSPECT_MAX_BYTES = 2; - -var b = Buffer.allocUnsafe(4); -b.fill('1234'); - -var s = buffer.SlowBuffer(4); -s.fill('1234'); - -var expected = ''; - -assert.strictEqual(util.inspect(b), expected); -assert.strictEqual(util.inspect(s), expected); - -b = Buffer.allocUnsafe(2); -b.fill('12'); - -s = buffer.SlowBuffer(2); -s.fill('12'); - -expected = ''; - -assert.strictEqual(util.inspect(b), expected); -assert.strictEqual(util.inspect(s), expected); - -buffer.INSPECT_MAX_BYTES = Infinity; - -assert.doesNotThrow(function() { - assert.strictEqual(util.inspect(b), expected); - assert.strictEqual(util.inspect(s), expected); -}); - -- 2.34.1