Skip to content

Commit 847d740

Browse files
tniessendanielleadams
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 b9dd876 commit 847d740

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

Lines 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
{

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

Lines 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
}

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

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy