2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-07-15 15:43:24 -04:00
|
|
|
const common = require('../common');
|
2016-12-30 18:38:06 -05:00
|
|
|
const assert = require('assert');
|
2012-02-03 18:29:58 +02:00
|
|
|
|
2016-12-30 18:38:06 -05:00
|
|
|
const net = require('net');
|
2012-02-03 18:29:58 +02:00
|
|
|
|
2017-01-08 13:19:00 +00:00
|
|
|
const host = '*'.repeat(256);
|
2012-02-03 18:29:58 +02:00
|
|
|
|
|
|
|
function do_not_call() {
|
|
|
|
throw new Error('This function should not have been called.');
|
|
|
|
}
|
|
|
|
|
2017-01-08 13:19:00 +00:00
|
|
|
const socket = net.connect(42, host, do_not_call);
|
2016-07-15 15:43:24 -04:00
|
|
|
socket.on('error', common.mustCall(function(err) {
|
2017-01-08 15:36:25 +00:00
|
|
|
assert.strictEqual(err.code, 'ENOTFOUND');
|
2016-07-15 15:43:24 -04:00
|
|
|
}));
|
2013-05-07 11:55:12 -07:00
|
|
|
socket.on('lookup', function(err, ip, type) {
|
|
|
|
assert(err instanceof Error);
|
2017-01-08 15:36:25 +00:00
|
|
|
assert.strictEqual(err.code, 'ENOTFOUND');
|
|
|
|
assert.strictEqual(ip, undefined);
|
|
|
|
assert.strictEqual(type, undefined);
|
2013-05-07 11:55:12 -07:00
|
|
|
});
|