1 |
root |
1.1 |
$|=1; |
2 |
|
|
BEGIN { print "1..5\n" } |
3 |
|
|
|
4 |
|
|
# we avoid complicated tests here because some systems will |
5 |
|
|
# not have working DNS |
6 |
|
|
|
7 |
|
|
use AnyEvent::Impl::IOAsync; |
8 |
|
|
use IO::Async::Loop; AnyEvent::Impl::IOAsync::set_loop new IO::Async::Loop; |
9 |
|
|
|
10 |
|
|
use AnyEvent::DNS; |
11 |
|
|
|
12 |
|
|
print "ok 1\n"; |
13 |
|
|
|
14 |
|
|
AnyEvent::DNS::resolver; |
15 |
|
|
|
16 |
|
|
print "ok 2\n"; |
17 |
|
|
|
18 |
|
|
# make sure we timeout faster |
19 |
|
|
AnyEvent::DNS::resolver->{timeout} = [0.5]; |
20 |
|
|
AnyEvent::DNS::resolver->_compile; |
21 |
|
|
|
22 |
|
|
print "ok 3\n"; |
23 |
|
|
|
24 |
|
|
my $cv = AnyEvent->condvar; |
25 |
|
|
|
26 |
|
|
AnyEvent::DNS::a "www.google.de", sub { |
27 |
|
|
print "ok 4 # www.google.de => @_\n"; |
28 |
|
|
$cv->send; |
29 |
|
|
}; |
30 |
|
|
|
31 |
|
|
$cv->recv; |
32 |
|
|
|
33 |
|
|
print "ok 5\n"; |
34 |
|
|
|