]> zoso.dev Git - buffer.git/commitdiff
Skip destructive test-buffer-inspect.js test
authorFeross Aboukhadijeh <feross@feross.org>
Fri, 16 Feb 2018 09:12:49 +0000 (01:12 -0800)
committerFeross Aboukhadijeh <feross@feross.org>
Fri, 16 Feb 2018 09:12:49 +0000 (01:12 -0800)
bin/download-node-tests.js
test/node/test-buffer-inspect.js [deleted file]

index 8b08fc3b6df80572f40a15c0699dff8a71442c00..c05a98e6b4541e24da604d7eec987048a5da3875 100755 (executable)
@@ -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 (file)
index d0ed590..0000000
+++ /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 = '<Buffer 31 32 ... >';
-
-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 = '<Buffer 31 32>';
-
-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);
-});
-