mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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: https://github.com/nodejs/node/pull/44633 PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
7b64cec090
commit
2472b6742c
@ -19,8 +19,8 @@ const env = {
|
||||
|
||||
tmpdir.refresh();
|
||||
function checkOutput(stderr, stdout) {
|
||||
assert(stdout.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/));
|
||||
assert(stdout.match(stdout, /family: 4/));
|
||||
assert.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/);
|
||||
assert.match(stdout, /family: 4/);
|
||||
assert.strictEqual(stdout.trim().split('\n').length, 2);
|
||||
}
|
||||
{
|
||||
|
@ -19,8 +19,8 @@ function checkOutput(stderr, stdout) {
|
||||
// We allow failures as it's not always possible to resolve localhost.
|
||||
// Functional tests are done in test/internet instead.
|
||||
if (!stderr.startsWith('error:')) {
|
||||
assert(stdout.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/));
|
||||
assert(stdout.match(stdout, /family: 4/));
|
||||
assert.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/);
|
||||
assert.match(stdout, /family: 4/);
|
||||
assert.strictEqual(stdout.trim().split('\n').length, 2);
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ function checkOutput(stderr, stdout) {
|
||||
// We allow failures as it's not always possible to resolve localhost.
|
||||
// Functional tests are done in test/internet instead.
|
||||
if (!stderr.startsWith('error:')) {
|
||||
assert(stdout.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/));
|
||||
assert(stdout.match(stdout, /family: 4/));
|
||||
assert.match(stdout, /address: "\d+\.\d+\.\d+\.\d+"/);
|
||||
assert.match(stdout, /family: 4/);
|
||||
assert.strictEqual(stdout.trim().split('\n').length, 2);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user