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