Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a41138b

Browse filesBrowse files
ZYSzysBridgeAR
authored andcommitted
test: remove duplicated buffer negative allocation test
PR-URL: #26160 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
1 parent 3bc0123 commit a41138b
Copy full SHA for a41138b

File tree

Expand file treeCollapse file tree

2 files changed

+6
-18
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-18
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-negative-length.js
-17Lines changed: 0 additions & 17 deletions
This file was deleted.
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-no-negative-allocation.js
+6-1Lines changed: 6 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.