Skip to content

Commit a41138b

Browse files
ZYSzysBridgeAR
authored andcommitted
test: remove duplicated buffer negative allocation test
PR-URL: #26160 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]>
1 parent 3bc0123 commit a41138b

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

test/parallel/test-buffer-negative-length.js

-17
This file was deleted.

test/parallel/test-buffer-no-negative-allocation.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
const common = require('../common');
44
const assert = require('assert');
5+
const { SlowBuffer } = require('buffer');
56

67
const msg = common.expectsError({
78
code: 'ERR_INVALID_OPT_VALUE',
89
type: RangeError,
910
message: /^The value "[^"]*" is invalid for option "size"$/
10-
}, 12);
11+
}, 15);
1112

1213
// Test that negative Buffer length inputs throw errors.
1314

@@ -26,3 +27,7 @@ assert.throws(() => Buffer.allocUnsafe(-1), msg);
2627
assert.throws(() => Buffer.allocUnsafeSlow(-Buffer.poolSize), msg);
2728
assert.throws(() => Buffer.allocUnsafeSlow(-100), msg);
2829
assert.throws(() => Buffer.allocUnsafeSlow(-1), msg);
30+
31+
assert.throws(() => SlowBuffer(-Buffer.poolSize), msg);
32+
assert.throws(() => SlowBuffer(-100), msg);
33+
assert.throws(() => SlowBuffer(-1), msg);

0 commit comments

Comments
 (0)