3 use Test::More tests => 3;
7 my $h = AnyEvent::HTTPD->new (port => 19090);
14 my ($httpd, $req) = @_;
15 $req_url = $req->url->path;
18 my ($httpd, $req) = @_;
19 $req_url2 = $req->url->path;
20 $req->respond ({ content => ['text/plain', "Test response"] });
25 my $t = AnyEvent->timer (after => 0.1, cb => sub {
29 $c = AnyEvent->child (pid => $p, cb => sub {
33 my $out = `wget http://localhost:19090/test -O/tmp/anyevent_httpd_test 2>&1 >/dev/null`;
43 is ($req_url, "/test", "the path of the request URL was ok");
44 is ($req_url2, "/test", "the path of the second request URL was ok");
45 is (`cat /tmp/anyevent_httpd_test`, 'Test response', "the response text was ok");