X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=t%2F24-sorting.t;h=e7f1b77074e9c97c0dc24278a3b88b714d78d86f;hb=890fe6b1653075506ce277c9131de8646e72a18c;hp=155359dd24b0b7d88e3b47d5dbd4cbec89433819;hpb=33ab99ed17f92d8c84e580f3708b9d6d27fa1bc7;p=ZOOM-Perl-moved-to-github.git diff --git a/t/24-sorting.t b/t/24-sorting.t index 155359d..e7f1b77 100644 --- a/t/24-sorting.t +++ b/t/24-sorting.t @@ -1,18 +1,14 @@ -# $Id: 24-sorting.t,v 1.1 2005-11-04 17:08:20 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' -# -# ### At present, this test fails: see comment to "14-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'"); @@ -40,8 +36,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) {