GeezerVison is showing github.com — test: move hasMultiLocalhost to common/net · nodejs/node@a62345e
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/common/README.md -6Lines changed: 0 additions & 6 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -238,12 +238,6 @@ Indicates if [internationalization][] is supported. | 238 | 238 |
| 239 | 239 | Indicates whether `IPv6` is supported on this platform. | 240 | 240 |
| 241 | | -### `hasMultiLocalhost` | 242 | | - | 243 | | -* [\<boolean>][<boolean>] | 244 | | - | 245 | | -Indicates if there are multiple localhosts available. | 246 | | - | 247 | 241 | ### `inFreeBSDJail` | 248 | 242 |
| 249 | 243 | * [\<boolean>][<boolean>] | |
Collapse file Copy file name to clipboardExpand all lines: test/common/index.js -10Lines changed: 0 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -489,15 +489,6 @@ function _mustCallInner(fn, criteria = 1, field) { | 489 | 489 | return _return; | 490 | 490 | } | 491 | 491 |
| 492 | | -function hasMultiLocalhost() { | 493 | | - const { internalBinding } = require('internal/test/binding'); | 494 | | - const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap'); | 495 | | - const t = new TCP(TCPConstants.SOCKET); | 496 | | - const ret = t.bind('127.0.0.2', 0); | 497 | | - t.close(); | 498 | | - return ret === 0; | 499 | | -} | 500 | | - | 501 | 492 | function skipIfEslintMissing() { | 502 | 493 | if (!fs.existsSync( | 503 | 494 | path.join(__dirname, '..', '..', 'tools', 'eslint', 'node_modules', 'eslint'), | @@ -965,7 +956,6 @@ const common = { | 965 | 956 | hasIntl, | 966 | 957 | hasCrypto, | 967 | 958 | hasQuic, | 968 | | - hasMultiLocalhost, | 969 | 959 | invalidArgTypeHelper, | 970 | 960 | isAlive, | 971 | 961 | isASan, | |
Collapse file Copy file name to clipboardExpand all lines: test/common/index.mjs -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,6 @@ const { | 20 | 20 | hasCrypto, | 21 | 21 | hasIntl, | 22 | 22 | hasIPv6, | 23 | | - hasMultiLocalhost, | 24 | 23 | isAIX, | 25 | 24 | isAlive, | 26 | 25 | isDumbTerminal, | @@ -75,7 +74,6 @@ export { | 75 | 74 | hasCrypto, | 76 | 75 | hasIntl, | 77 | 76 | hasIPv6, | 78 | | - hasMultiLocalhost, | 79 | 77 | isAIX, | 80 | 78 | isAlive, | 81 | 79 | isDumbTerminal, | |
Collapse file Copy file name to clipboardExpand all lines: test/common/net.js +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,17 @@ function checkSupportReusePort() { | 17 | 17 | }); | 18 | 18 | } | 19 | 19 |
| | 20 | +function hasMultiLocalhost() { | | 21 | + const { internalBinding } = require('internal/test/binding'); | | 22 | + const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap'); | | 23 | + const t = new TCP(TCPConstants.SOCKET); | | 24 | + const ret = t.bind('127.0.0.2', 0); | | 25 | + t.close(); | | 26 | + return ret === 0; | | 27 | +} | | 28 | + | 20 | 29 | module.exports = { | 21 | 30 | checkSupportReusePort, | | 31 | + hasMultiLocalhost, | 22 | 32 | options, | 23 | 33 | }; |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http-localaddress.js +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 22 | 22 | // Flags: --expose-internals | 23 | 23 | 'use strict'; | 24 | 24 | const common = require('../common'); | 25 | | -if (!common.hasMultiLocalhost()) | | 25 | +const { hasMultiLocalhost } = require('../common/net'); | | 26 | +if (!hasMultiLocalhost()) { | 26 | 27 | common.skip('platform-specific test.'); | | 28 | +} | 27 | 29 |
| 28 | 30 | const http = require('http'); | 29 | 31 | const assert = require('assert'); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http2-connect-options.js +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,8 +4,10 @@ const common = require('../common'); | 4 | 4 | if (!common.hasCrypto) | 5 | 5 | common.skip('missing crypto'); | 6 | 6 |
| 7 | | -if (!common.hasMultiLocalhost()) | | 7 | +const { hasMultiLocalhost } = require('../common/net'); | | 8 | +if (!hasMultiLocalhost()) { | 8 | 9 | common.skip('platform-specific test.'); | | 10 | +} | 9 | 11 |
| 10 | 12 | const http2 = require('http2'); | 11 | 13 | const assert = require('assert'); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-https-localaddress.js +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,8 +25,10 @@ const common = require('../common'); | 25 | 25 | if (!common.hasCrypto) | 26 | 26 | common.skip('missing crypto'); | 27 | 27 |
| 28 | | -if (!common.hasMultiLocalhost()) | | 28 | +const { hasMultiLocalhost } = require('../common/net'); | | 29 | +if (!hasMultiLocalhost()) { | 29 | 30 | common.skip('platform-specific test.'); | | 31 | +} | 30 | 32 |
| 31 | 33 | const fixtures = require('../common/fixtures'); | 32 | 34 | const assert = require('assert'); | |
|