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 7606136

Browse filesBrowse files
tniessenMylesBorins
authored andcommitted
test: fix assertions in test-snapshot-dns-lookup*
Due to the unfortunate nature of JavaScript, the extraneous arguments are silently ignored. In this case, the assertion trivially passes regardless of the given regular expressions. Refs: #44633 PR-URL: #46618 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent c07511b commit 7606136
Copy full SHA for 7606136

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

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

‎test/internet/test-snapshot-dns-lookup.js‎

Copy file name to clipboardExpand all lines: test/internet/test-snapshot-dns-lookup.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const env = {
1919

2020
tmpdir.refresh();
2121
function checkOutput(stderr, stdout) {
22-
assert(stdout.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/));
23-
assert(stdout.match(stdout, /family: 4/));
22+
assert.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/);
23+
assert.match(stdout, /family: 4/);
2424
assert.strictEqual(stdout.trim().split('\n').length, 2);
2525
}
2626
{
Collapse file

‎test/parallel/test-snapshot-dns-lookup-localhost-promise.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-snapshot-dns-lookup-localhost-promise.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function checkOutput(stderr, stdout) {
1919
// We allow failures as it's not always possible to resolve localhost.
2020
// Functional tests are done in test/internet instead.
2121
if (!stderr.startsWith('error:')) {
22-
assert(stdout.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/));
23-
assert(stdout.match(stdout, /family: 4/));
22+
assert.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/);
23+
assert.match(stdout, /family: 4/);
2424
assert.strictEqual(stdout.trim().split('\n').length, 2);
2525
}
2626
}
Collapse file

‎test/parallel/test-snapshot-dns-lookup-localhost.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-snapshot-dns-lookup-localhost.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function checkOutput(stderr, stdout) {
1919
// We allow failures as it's not always possible to resolve localhost.
2020
// Functional tests are done in test/internet instead.
2121
if (!stderr.startsWith('error:')) {
22-
assert(stdout.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/));
23-
assert(stdout.match(stdout, /family: 4/));
22+
assert.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/);
23+
assert.match(stdout, /family: 4/);
2424
assert.strictEqual(stdout.trim().split('\n').length, 2);
2525
}
2626
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.