X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=t%2F24-sorting.t;h=c3e7cf3e5d5a8ed1464c51343be243acc80b1824;hb=bc1064f676d60c92f03cb0cf5d05fbca4f2fd7a6;hp=687ec65cc7fbb43e3904279125e0314802effce1;hpb=e82dfe2405281bd9c283fa2adf1bdcc5e4a7db5e;p=ZOOM-Perl-moved-to-github.git diff --git a/t/24-sorting.t b/t/24-sorting.t index 687ec65..c3e7cf3 100644 --- a/t/24-sorting.t +++ b/t/24-sorting.t @@ -1,16 +1,16 @@ -# $Id: 24-sorting.t,v 1.2 2005-11-07 16:30:50 mike Exp $ +# $Id: 24-sorting.t,v 1.7 2006-11-02 17:48:26 mike Exp $ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 24-sorting.t' use strict; use warnings; -use Test::More tests => 27; +use Test::More tests => 29; use MARC::Record; BEGIN { use_ok('ZOOM') }; -my $host = "indexdata.com/gils"; +my $host = "z3950.indexdata.com/gils"; my $conn; eval { $conn = new ZOOM::Connection($host, 0) }; ok(!$@, "connection to '$host'"); @@ -38,8 +38,10 @@ foreach my $i (1 .. $n) { } # Now reverse the order of sorting -$rs->sort("dummy", "1=4 >i"); -### There's no way to check for success, as this is a void function +my $status = $rs->sort("yaz", "1=4>i"); +ok($status < 0, "malformed sort criterion rejected"); +$status = $rs->sort("yaz", "1=4 >i"); +ok($status == 0, "sort criterion accepted"); $previous = "z"; # Sorts after all legitimate titles foreach my $i (1 .. $n) {