mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
488 B
16 lines
488 B
9 years ago
|
'use strict';
|
||
|
|
||
|
// Flags: --expose-internals
|
||
|
|
||
|
require('../common');
|
||
|
const assert = require('assert');
|
||
|
const net = require('internal/net');
|
||
|
|
||
|
assert.strictEqual(net.isLegalPort(''), false);
|
||
|
assert.strictEqual(net.isLegalPort('0'), true);
|
||
|
assert.strictEqual(net.isLegalPort(0), true);
|
||
|
assert.strictEqual(net.isLegalPort(65536), false);
|
||
|
assert.strictEqual(net.isLegalPort('65535'), true);
|
||
|
assert.strictEqual(net.isLegalPort(undefined), false);
|
||
|
assert.strictEqual(net.isLegalPort(null), true);
|