From 651d213c4d38b8606fe6329ff10ac8378c258966 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Thu, 18 Aug 2011 14:20:28 +0300 Subject: [PATCH] Apply style changes to *.t --- t/00_use.t | 2 +- t/01_codes.t | 53 +++++++++++++++++++++++-------------------------- t/02_Media_defaults.t | 29 ++++++++++++++------------- t/03_Options_defaults.t | 25 ++++++++++++----------- t/04_Query_defaults.t | 15 +++++++------- t/pod.t | 2 +- t/query.t | 3 ++- t/support.t | 4 +++- 8 files changed, 68 insertions(+), 65 deletions(-) diff --git a/t/00_use.t b/t/00_use.t index f3bdae1..8cfe112 100644 --- a/t/00_use.t +++ b/t/00_use.t @@ -23,6 +23,6 @@ use strict; use Test::More tests => 1; -BEGIN { use_ok('WWW::Quvi') }; +BEGIN {use_ok('WWW::Quvi')} # vim: set ts=2 sw=2 tw=72 expandtab: diff --git a/t/01_codes.t b/t/01_codes.t index 1682257..7ddc9da 100644 --- a/t/01_codes.t +++ b/t/01_codes.t @@ -25,47 +25,44 @@ use Test::More; use WWW::Quvi; my @return = ( - WWW::Quvi::OK, - WWW::Quvi::Mem, - WWW::Quvi::BadHandle, - WWW::Quvi::InvArg, - WWW::Quvi::CurlInit, - WWW::Quvi::Last, - WWW::Quvi::AbortedByCallback, - WWW::Quvi::LuaInit, - WWW::Quvi::NoLuaWebsite, - WWW::Quvi::NoLuaUtil, - WWW::Quvi::NoSupport, - WWW::Quvi::CallbackError, - WWW::Quvi::IconvError, - WWW::Quvi::LuaError -); + WWW::Quvi::OK, WWW::Quvi::Mem, + WWW::Quvi::BadHandle, WWW::Quvi::InvArg, + WWW::Quvi::CurlInit, WWW::Quvi::Last, + WWW::Quvi::AbortedByCallback, WWW::Quvi::LuaInit, + WWW::Quvi::NoLuaWebsite, WWW::Quvi::NoLuaUtil, + WWW::Quvi::NoSupport, WWW::Quvi::CallbackError, + WWW::Quvi::IconvError, WWW::Quvi::LuaError + ); my @proto = ( - WWW::Quvi::ProtoHttp, - WWW::Quvi::ProtoMms, - WWW::Quvi::ProtoRtsp, - WWW::Quvi::ProtoRtmp, - WWW::Quvi::ProtoAll -); + WWW::Quvi::ProtoHttp, WWW::Quvi::ProtoMms, + WWW::Quvi::ProtoRtsp, WWW::Quvi::ProtoRtmp, + WWW::Quvi::ProtoAll + ); plan tests => scalar @return + scalar @proto; my $n = -1; -foreach (@return) { +foreach (@return) +{ is($_, ++$n); -# diag "$_,$n\n"; + + # diag "$_,$n\n"; $n = 0x40 if $n == WWW::Quvi::NoLuaUtil; } $n = 1; -foreach (@proto) { +foreach (@proto) +{ is($_, $n); -# diag "$_,$n\n"; - if ($n == WWW::Quvi::ProtoRtmp) { - $n = 0x1|0x2|0x4|0x8; + + # diag "$_,$n\n"; + if ($n == WWW::Quvi::ProtoRtmp) + { + $n = 0x1 | 0x2 | 0x4 | 0x8; } - else { + else + { $n = $n << 1; } } diff --git a/t/02_Media_defaults.t b/t/02_Media_defaults.t index 8bc77d4..2669adf 100644 --- a/t/02_Media_defaults.t +++ b/t/02_Media_defaults.t @@ -25,26 +25,27 @@ use Test::More; use WWW::Quvi; my %h = ( - start_time => '', - page_url => '', - page_title => '', - host => '', - id => '', - content_length=> -1, - content_type => '', - file_suffix => '', - url => '', - thumbnail_url => '', - duration => -1 -); + start_time => '', + page_url => '', + page_title => '', + host => '', + id => '', + content_length => -1, + content_type => '', + file_suffix => '', + url => '', + thumbnail_url => '', + duration => -1 + ); plan tests => keys(%h) + 1; my $m = new WWW::Quvi::Media; isa_ok($m, 'WWW::Quvi::Media'); -for my $k (keys %h) { - is($m->{$k}, $h{$k}); # Test default. +for my $k (keys %h) +{ + is($m->{$k}, $h{$k}); # Test default. } # vim: set ts=2 sw=2 tw=72 expandtab: diff --git a/t/03_Options_defaults.t b/t/03_Options_defaults.t index 6e3f4a2..6c04461 100644 --- a/t/03_Options_defaults.t +++ b/t/03_Options_defaults.t @@ -25,23 +25,24 @@ use Test::More; use WWW::Quvi; my %h = ( - user_agent => '', - http_proxy => '', - format => 'default', - verify => 1, - verbose_libcurl => 0, - resolve => 1, - category => WWW::Quvi::ProtoAll -); + user_agent => '', + http_proxy => '', + format => 'default', + verify => 1, + verbose_libcurl => 0, + resolve => 1, + category => WWW::Quvi::ProtoAll + ); -plan tests => keys(%h)*2 + 1; +plan tests => keys(%h) * 2 + 1; my $o = new WWW::Quvi::Options; isa_ok($o, 'WWW::Quvi::Options'); -for my $k (keys %h) { - is($o->{$k}, $h{$k}); # Test default. - $o->{$k} = '1'; # Test set. +for my $k (keys %h) +{ + is($o->{$k}, $h{$k}); # Test default. + $o->{$k} = '1'; # Test set. is($o->{$k}, 1); } diff --git a/t/04_Query_defaults.t b/t/04_Query_defaults.t index 0c84418..68d4168 100644 --- a/t/04_Query_defaults.t +++ b/t/04_Query_defaults.t @@ -25,19 +25,20 @@ use Test::More; use WWW::Quvi; my %h = ( - errmsg => '', - quvi_code => 0, - resp_code => -1, - ok => 1 -); + errmsg => '', + quvi_code => 0, + resp_code => -1, + ok => 1 + ); plan tests => keys(%h) + 1; my $q = new WWW::Quvi::Query; isa_ok($q, 'WWW::Quvi::Query'); -for my $k (keys %h) { - is($q->{$k}, $h{$k}); # Test default. +for my $k (keys %h) +{ + is($q->{$k}, $h{$k}); # Test default. } # vim: set ts=2 sw=2 tw=72 expandtab: diff --git a/t/pod.t b/t/pod.t index 09fb09f..2e129f5 100644 --- a/t/pod.t +++ b/t/pod.t @@ -8,4 +8,4 @@ plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; my @poddirs = qw(blib); -all_pod_files_ok (all_pod_files(@poddirs)); +all_pod_files_ok(all_pod_files(@poddirs)); diff --git a/t/query.t b/t/query.t index 78b140f..e8a727f 100644 --- a/t/query.t +++ b/t/query.t @@ -25,7 +25,7 @@ use Test::More; use WWW::Quvi; $ENV{HAVE_INTERNET} - ? plan tests => 2 + ? plan tests => 2 : plan skip_all => 'Set HAVE_INTERNET to enable'; use constant URL => @@ -37,6 +37,7 @@ my $q = new WWW::Quvi::Query; my $fmts = $q->formats(URL); is($q->{ok}, 1) or diag $q->{errmsg}; + #diag $fmts; # Media. diff --git a/t/support.t b/t/support.t index 564d225..780fdce 100644 --- a/t/support.t +++ b/t/support.t @@ -29,11 +29,13 @@ my $q = new WWW::Quvi::Query; # Next (supported) website. my $n = 0; -while ($q->{ok}) { +while ($q->{ok}) +{ my ($d) = $q->next_website; ++$n if $q->{ok}; } isnt($n, 0); + #diag $n; # Supported. -- 2.11.4.GIT