blob: 74b76c5c2565c146585d186659beee65a2330c91 [file] [log] [blame]
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verifies that one can provide timeout handler for InternetAddress.lookup,
// which was reported broken
import "dart:io";
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
void main() async {
final result = <InternetAddress>[];
try {
result.addAll(await InternetAddress.lookup("")
.timeout(const Duration(milliseconds: 1), onTimeout: () => []));
} catch (e) {
print('managed to fail with $e lookup before timeout');