Skip to content

Commit

Permalink
test: add IPv6 brackets but no port to test-dns
Browse files Browse the repository at this point in the history
Add a test case to test-dns to check that supply an IPv6 host with
brackets but no explicit port to `dns.setServers()` yields expected
results. This is the final bit of test coverage missing for
lib/internal/dns/utils.js.

PR-URL: #27006
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
Trott authored and BethGriggs committed Apr 9, 2019
1 parent af3ce38 commit 35119d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ const ports = [
'4.4.4.4:53',
'[2001:4860:4860::8888]:53',
'103.238.225.181:666',
'[fe80::483a:5aff:fee6:1f04]:666'
'[fe80::483a:5aff:fee6:1f04]:666',
'[fe80::483a:5aff:fee6:1f04]',
];
const portsExpected = [
'4.4.4.4',
'2001:4860:4860::8888',
'103.238.225.181:666',
'[fe80::483a:5aff:fee6:1f04]:666'
'[fe80::483a:5aff:fee6:1f04]:666',
'fe80::483a:5aff:fee6:1f04',
];
dns.setServers(ports);
assert.deepStrictEqual(dns.getServers(), portsExpected);
Expand Down

0 comments on commit 35119d6

Please sign in to comment.