X-Git-Url: http://erislabs.net/gitweb/?p=libwww-opensearch-perl.git;a=blobdiff_plain;f=t%2F10-description.t;h=4e23a8c839d1a864aee398f0e171946ae8f2bdc1;hp=4270b3b3126cab8d1ca36d4d5f748f7178b51a5c;hb=51d6cd8e2223091f60850c0eecab47a50a21fb30;hpb=d3c1dfd242036eb00a38bd6466ee45df7cb7215e diff --git a/t/10-description.t b/t/10-description.t index 4270b3b..4e23a8c 100644 --- a/t/10-description.t +++ b/t/10-description.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 38; +use Test::More tests => 48; use_ok( 'WWW::OpenSearch::Description' ); @@ -27,7 +27,7 @@ use_ok( 'WWW::OpenSearch::Description' ); is( $osd->contact, 'admin@example.com' ); # count the urls - is( $osd->urls, 1 ); + is( $osd->urls, 1, 'number of url objects' ); } # complex 1.1 OSD @@ -83,15 +83,24 @@ use_ok( 'WWW::OpenSearch::Description' ); is( $osd->adultcontent, 'false' ); is( $osd->syndicationright, 'open' ); - is( $osd->image, 'http://example.com/websearch.png' ); - -SKIP: { - skip 'Test Query', 1; - is( $osd->query, undef ); - }; + my $queries = $osd->query; + is( scalar @$queries, 1, 'number of query objects' ); + is( $queries->[ 0 ]->role, 'example' ); + is( $queries->[ 0 ]->searchTerms, 'cat' ); + + my $images = $osd->image; + is( scalar @$images, 2, 'number of image objects' ); + is( $images->[ 0 ]->height, 64 ); + is( $images->[ 0 ]->width, 64 ); + is( $images->[ 0 ]->type, 'image/png' ); + is( $images->[ 0 ]->url, 'http://example.com/websearch.png' ); + is( $images->[ 1 ]->height, 16 ); + is( $images->[ 1 ]->width, 16 ); + is( $images->[ 1 ]->type, 'image/vnd.microsoft.icon' ); + is( $images->[ 1 ]->url, 'http://example.com/websearch.ico' ); # count the urls - is( $osd->urls, 3 ); + is( $osd->urls, 3, 'number of url objects' ); } # 1.0 OSD