Revision: | 1.7 |
Committed: | Tue Jul 30 23:14:33 2013 UTC (11 years, 4 months ago) by root |
Content type: | application/x-troff |
Branch: | MAIN |
CVS Tags: | rel-7_05, rel-7_07, rel-7_08, rel-7_09, rel-7_16, rel-7_15, rel-7_14, rel-7_13, rel-7_12, rel-7_11, HEAD |
Changes since 1.6: | +1 -0 lines |
Log Message: | *** empty log message *** |
# | Content |
---|---|
1 | # we avoid complicated tests here because some systems will |
2 | # not have working DNS |
3 | |
4 | use AnyEvent; |
5 | |
6 | BEGIN { $^W = 0 } |
7 | BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } |
8 | BEGIN { eval q{use AnyEvent::Impl::Event;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Event not loadable\n}), exit 0) } |
9 | |
10 | |
11 | use AnyEvent::DNS; |
12 | |
13 | $| = 1; print "1..5\n"; |
14 | |
15 | print "ok 1\n"; |
16 | |
17 | AnyEvent::DNS::resolver; |
18 | |
19 | print "ok 2\n"; |
20 | |
21 | # make sure we timeout faster |
22 | AnyEvent::DNS::resolver->{timeout} = [0.5]; |
23 | AnyEvent::DNS::resolver->_compile; |
24 | |
25 | print "ok 3\n"; |
26 | |
27 | my $cv = AnyEvent->condvar; |
28 | |
29 | AnyEvent::DNS::a "www.google.de", sub { |
30 | print "ok 4 # www.google.de => @_\n"; |
31 | $cv->send; |
32 | }; |
33 | |
34 | $cv->recv; |
35 | |
36 | print "ok 5\n"; |
37 |