diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2021-09-05 17:38:36 +0200 |
---|---|---|
committer | Beth Griggs <bgriggs@redhat.com> | 2021-09-22 00:27:15 +0100 |
commit | 6be405bd7bf1d23dd1d6d1b795b83a226f638f4b (patch) | |
tree | 6616e1742994adf8b54b2a07b08e26722517fbd6 | |
parent | b6939a3419d96a3c9a76baba59b6455998d80d1f (diff) | |
download | node-new-6be405bd7bf1d23dd1d6d1b795b83a226f638f4b.tar.gz |
test: fix test-dgram-udp6-link-local-address on Windows
PR-URL: https://github.com/nodejs/node/pull/40005
Reviewed-By: Rich Trott <rtrott@gmail.com>
-rw-r--r-- | test/parallel/test-dgram-udp6-link-local-address.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/parallel/test-dgram-udp6-link-local-address.js b/test/parallel/test-dgram-udp6-link-local-address.js index bb7307de24..5c090acc6b 100644 --- a/test/parallel/test-dgram-udp6-link-local-address.js +++ b/test/parallel/test-dgram-udp6-link-local-address.js @@ -7,6 +7,8 @@ const assert = require('assert'); const dgram = require('dgram'); const os = require('os'); +const { isWindows } = common; + function linklocal() { for (const [ifname, entries] of Object.entries(os.networkInterfaces())) { for (const { address, family, scopeid } of entries) { @@ -21,7 +23,7 @@ const iface = linklocal(); if (!iface) common.skip('cannot find any IPv6 interfaces with a link local address'); -const address = `${iface.address}%${iface.ifname}`; +const address = isWindows ? iface.address : `${iface.address}%${iface.ifname}`; const message = 'Hello, local world!'; // Create a client socket for sending to the link-local address. @@ -42,7 +44,7 @@ server.on('message', common.mustCall((buf, info) => { // including the link local scope identifier. assert.strictEqual( info.address, - common.isWindows ? `${iface.address}%${iface.scopeid}` : address + isWindows ? `${iface.address}%${iface.scopeid}` : address ); server.close(); client.close(); |