5 use Test::More tests => 36;
6 BEGIN { use_ok('WWW::Quvi') };
10 like (&WWW::Quvi::version, qr{^\d+.\d+$});
12 like (&WWW::Quvi::version(WWW::Quvi::ModuleVersion), qr{^\d+.\d+$});
15 &WWW::Quvi::version(WWW::Quvi::libquviVersion), qr{^\d+.\d+.\d+$});
18 &WWW::Quvi::version(WWW::Quvi::libquviVersionLong),
19 qr{^\d+.\d+.\d+.* built on \d+.\d+.\d+ .* (.*)$}
24 my $opts = new WWW::Quvi::Options;
25 isa_ok ($opts, 'WWW::Quvi::Options');
27 is ($opts->{user_agent}, "");
28 is ($opts->{http_proxy}, "");
29 is ($opts->{format}, "default");
30 is ($opts->{verify}, 1);
31 is ($opts->{verbose_libcurl}, "");
32 is ($opts->{shortened}, 1);
34 $opts->{user_agent} = "Mozilla/5.0";
35 is ($opts->{user_agent}, "Mozilla/5.0");
37 $opts->{http_proxy} = "http://foo:1234";
38 is ($opts->{http_proxy}, "http://foo:1234");
40 $opts->{format} = "hd";
41 is ($opts->{format}, "hd");
44 is ($opts->{verify}, "");
46 $opts->{verbose_libcurl} = 1;
47 is ($opts->{verbose_libcurl}, 1);
49 $opts->{shortened} = 0;
50 is ($opts->{shortened}, "");
54 my $l = new WWW::Quvi::Link;
55 isa_ok ($l, 'WWW::Quvi::Link');
57 is ($l->{content_type}, "");
58 is ($l->{file_suffix}, "");
59 is ($l->{length_bytes}, -1);
64 my $v = new WWW::Quvi::Video;
65 isa_ok ($v, 'WWW::Quvi::Video');
75 my $q = new WWW::Quvi::Query;
76 isa_ok ($q, 'WWW::Quvi::Query');
78 is ($q->{last_error}, "");
79 is ($q->{quvi_code}, 0);
80 is ($q->{resp_code}, -1);
84 my ($rc, $domain, $formats) = $q->next_website;
86 like ($domain, qr{^\w+.\w+$});
87 like ($formats, qr{^\w+(?:|)});
98 WWW::Quvi::AbortedByCallback,
100 WWW::Quvi::NoLuaWebsite,
101 WWW::Quvi::PcreError,
102 WWW::Quvi::NoSupport,
103 WWW::Quvi::CurlError,
104 WWW::Quvi::IconvError,