X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FWebService-Strike.t;h=42825e19196a469ed639a02d937b50487f544db1;hb=b1241fec123cd9dcc2e0e595dd018ad5655b637c;hp=ffd59ad64464f676f3bd97abb28864ee6d364023;hpb=27da1d36f6be05af35e74a57848cabf138cf3fc3;p=webservice-strike.git diff --git a/t/WebService-Strike.t b/t/WebService-Strike.t index ffd59ad..42825e1 100644 --- a/t/WebService-Strike.t +++ b/t/WebService-Strike.t @@ -3,7 +3,7 @@ use strict; use warnings; use Test::RequiresInternet qw/getstrike.net 80/; -use Test::More tests => 6; +use Test::More tests => 9; use Try::Tiny; BEGIN { use_ok('WebService::Strike') }; @@ -16,7 +16,7 @@ subtest 'order' => sub { is $t3->hash, '85DF191A921C20B2DDAFF72368CAB93BA18C5ACE', 'hash #3' }; -is $t1->date, 1420495200, 'date'; +is $t1->date, 1420502400, 'date'; is $t2->title, 'FreeBSD 7.1 i386.DVD.iso', 'title'; like $t1->torrent, qr/^d/, 'torrent file starts with d'; @@ -25,3 +25,14 @@ try { } catch { is $_->{status}, 404, 'non-existent torrent status is 404'; }; + +my @debian = strike_search 'Debian'; +ok @debian > 10, 'search for Debian returned more than 10 results'; +try { + strike_search "nosuchstring$$"; +} catch { + is $_->{status}, 404, "search for nosuchstring$$ returned 404" +}; + +my $p = strike_search 'Perl', 1; +is @{$p->file_names}, $p->count, 'file_names has count elements';