Skip to content

Commit 35119d6

Browse files
TrottBethGriggs
authored andcommitted
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: #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>
1 parent af3ce38 commit 35119d6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/parallel/test-dns.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,15 @@ const ports = [
121121
'4.4.4.4:53',
122122
'[2001:4860:4860::8888]:53',
123123
'103.238.225.181:666',
124-
'[fe80::483a:5aff:fee6:1f04]:666'
124+
'[fe80::483a:5aff:fee6:1f04]:666',
125+
'[fe80::483a:5aff:fee6:1f04]',
125126
];
126127
const portsExpected = [
127128
'4.4.4.4',
128129
'2001:4860:4860::8888',
129130
'103.238.225.181:666',
130-
'[fe80::483a:5aff:fee6:1f04]:666'
131+
'[fe80::483a:5aff:fee6:1f04]:666',
132+
'fe80::483a:5aff:fee6:1f04',
131133
];
132134
dns.setServers(ports);
133135
assert.deepStrictEqual(dns.getServers(), portsExpected);

0 commit comments

Comments
 (0)