X-Git-Url: http://erislabs.net/gitweb/?p=libwww-opensearch-perl.git;a=blobdiff_plain;f=t%2F13-request.t;fp=t%2F13-request.t;h=26f9c3e3096571201d7711cd0166c0a498fa1bb2;hp=41c56b1aade80c16f9f09fe0f74cf0323046eafd;hb=e021488790d05654b6a8f5e13896b29aad7da610;hpb=70fa825da53bce7cee2d56a3a9d3cbeb2b4c7076 diff --git a/t/13-request.t b/t/13-request.t index 41c56b1..26f9c3e 100644 --- a/t/13-request.t +++ b/t/13-request.t @@ -32,7 +32,7 @@ use_ok( 'WWW::OpenSearch::Request' ); isa_ok( $req, 'WWW::OpenSearch::Request' ); is( lc $req->method, 'post', 'method' ); is( $req->uri, 'https://intranet/search?format=html', 'uri' ); - is( $req->content, 'l=*&c=&s=iPod&o=1', 'content' ); + is( _sort_result( $req->content ), 'c=&l=*&o=1&s=iPod', 'content' ); } { @@ -43,3 +43,10 @@ use_ok( 'WWW::OpenSearch::Request' ); is( $req->uri, 'http://example.com/?q=iPod&pw=1&format=atom', 'uri' ); } } + +sub _sort_result { + my $s = shift; + return join( '&', + sort { substr( $a, 0, 1 ) cmp substr( $b, 0, 1 ) } + split( /\&/, $s ) ); +}