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