test: add IPv6 brackets but no port to test-dns
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: https://github.com/nodejs/node/pull/27006 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
c88d9577bb
commit
8afab1a5a7
@ -121,13 +121,15 @@ const ports = [
|
|||||||
'4.4.4.4:53',
|
'4.4.4.4:53',
|
||||||
'[2001:4860:4860::8888]:53',
|
'[2001:4860:4860::8888]:53',
|
||||||
'103.238.225.181:666',
|
'103.238.225.181:666',
|
||||||
'[fe80::483a:5aff:fee6:1f04]:666'
|
'[fe80::483a:5aff:fee6:1f04]:666',
|
||||||
|
'[fe80::483a:5aff:fee6:1f04]',
|
||||||
];
|
];
|
||||||
const portsExpected = [
|
const portsExpected = [
|
||||||
'4.4.4.4',
|
'4.4.4.4',
|
||||||
'2001:4860:4860::8888',
|
'2001:4860:4860::8888',
|
||||||
'103.238.225.181:666',
|
'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);
|
dns.setServers(ports);
|
||||||
assert.deepStrictEqual(dns.getServers(), portsExpected);
|
assert.deepStrictEqual(dns.getServers(), portsExpected);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user