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}), exit 0) } |
6 |
use AnyEvent::DNS; |
7 |
|
8 |
$| = 1; print "1..5\n"; |
9 |
|
10 |
print "ok 1\n"; |
11 |
|
12 |
AnyEvent::DNS::resolver; |
13 |
|
14 |
print "ok 2\n"; |
15 |
|
16 |
# make sure we timeout faster |
17 |
AnyEvent::DNS::resolver->{timeout} = [0.5]; |
18 |
AnyEvent::DNS::resolver->_compile; |
19 |
|
20 |
print "ok 3\n"; |
21 |
|
22 |
my $cv = AnyEvent->condvar; |
23 |
|
24 |
AnyEvent::DNS::a "www.google.de", sub { |
25 |
print "ok 4 # www.google.de => @_\n"; |
26 |
$cv->send; |
27 |
}; |
28 |
|
29 |
$cv->recv; |
30 |
|
31 |
print "ok 5\n"; |
32 |
|