File: author-99.pua-compat.t

package info (click to toggle)
libwww-curl-simple-perl 0.100191-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 240 kB
  • sloc: perl: 685; makefile: 4
file content (34 lines) | stat: -rw-r--r-- 784 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl -w

BEGIN {
  unless ($ENV{AUTHOR_TESTING}) {
    require Test::More;
    Test::More::plan(skip_all => 'these tests are for testing by the author');
  }
}


use strict;
use Test::More tests => 4;
use WWW::Curl::Simple;


my $pua = WWW::Curl::Simple->new();
#$pua->timeout(10);
#$pua->in_order(1);

{
    $pua->register(HTTP::Request->new(GET => 'http://en.wikipedia.org/wiki/Main_Page'));
    $pua->register(HTTP::Request->new(GET => 'http://www.yahoo.com'));
    
    my $results = $pua->wait;
    
    foreach (keys %$results) {
        my $req = $results->{$_};
        isa_ok($req, "WWW::Curl::Simple::Request");
        ok($req->response->is_success or $req->response->is_redirect, 
            "we have success!  " . $req->response->code
        );
    }
    
}