@@ -209,14 +209,14 @@ assert.deepStrictEqual(dns.getServers(), []);
209
209
{
210
210
/*
211
211
* Make sure that dns.lookup throws if hints does not represent a valid flag.
212
- * (dns.V4MAPPED | dns.ADDRCONFIG) + 1 is invalid because:
213
- * - it's different from dns.V4MAPPED and dns.ADDRCONFIG.
214
- * - it's different from them bitwise ored.
212
+ * (dns.V4MAPPED | dns.ADDRCONFIG | dns.ALL ) + 1 is invalid because:
213
+ * - it's different from dns.V4MAPPED and dns.ADDRCONFIG and dns.ALL .
214
+ * - it's different from any subset of them bitwise ored.
215
215
* - it's different from 0.
216
216
* - it's an odd number different than 1, and thus is invalid, because
217
217
* flags are either === 1 or even.
218
218
*/
219
- const hints = ( dns . V4MAPPED | dns . ADDRCONFIG ) + 1 ;
219
+ const hints = ( dns . V4MAPPED | dns . ADDRCONFIG | dns . ALL ) + 1 ;
220
220
const err = {
221
221
code : 'ERR_INVALID_OPT_VALUE' ,
222
222
name : 'TypeError' ,
@@ -254,11 +254,28 @@ dns.lookup('', {
254
254
hints : dns . ADDRCONFIG | dns . V4MAPPED
255
255
} , common . mustCall ( ) ) ;
256
256
257
+ dns . lookup ( '' , {
258
+ hints : dns . ALL
259
+ } , common . mustCall ( ) ) ;
260
+
261
+ dns . lookup ( '' , {
262
+ hints : dns . V4MAPPED | dns . ALL
263
+ } , common . mustCall ( ) ) ;
264
+
265
+ dns . lookup ( '' , {
266
+ hints : dns . ADDRCONFIG | dns . V4MAPPED | dns . ALL
267
+ } , common . mustCall ( ) ) ;
268
+
257
269
( async function ( ) {
258
270
await dnsPromises . lookup ( '' , { family : 4 , hints : 0 } ) ;
259
271
await dnsPromises . lookup ( '' , { family : 6 , hints : dns . ADDRCONFIG } ) ;
260
272
await dnsPromises . lookup ( '' , { hints : dns . V4MAPPED } ) ;
261
273
await dnsPromises . lookup ( '' , { hints : dns . ADDRCONFIG | dns . V4MAPPED } ) ;
274
+ await dnsPromises . lookup ( '' , { hints : dns . ALL } ) ;
275
+ await dnsPromises . lookup ( '' , { hints : dns . V4MAPPED | dns . ALL } ) ;
276
+ await dnsPromises . lookup ( '' , {
277
+ hints : dns . ADDRCONFIG | dns . V4MAPPED | dns . ALL
278
+ } ) ;
262
279
} ) ( ) ;
263
280
264
281
{
0 commit comments