From: mike Date: Tue, 11 Oct 2005 11:06:16 +0000 (+0000) Subject: Repace ZOOM.t with Net-Z3950-ZOOM.t X-Git-Tag: cpan_1_22~488 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=51ff9c6cc88bb648e65cfb405f81b8689f61aadc;p=ZOOM-Perl-moved-to-github.git Repace ZOOM.t with Net-Z3950-ZOOM.t Functionally equivalent. --- diff --git a/t/Net-Z3950-ZOOM.t b/t/Net-Z3950-ZOOM.t new file mode 100644 index 0000000..6f2d51c --- /dev/null +++ b/t/Net-Z3950-ZOOM.t @@ -0,0 +1,36 @@ +# Before `make install' is performed this script should be runnable with +# `make test'. After `make install' it should work as `perl Net-Z3950-ZOOM.t' + +######################### + +# change 'tests => 1' to 'tests => last_test_to_print'; + +use Test::More tests => 1; +BEGIN { use_ok('Net::Z3950::ZOOM') }; + +######################### + +# Insert your test code below, the Test::More module is use()ed here so read +# its man page ( perldoc Test::More ) for help writing this test script. + +my $host = "localhost"; +my $port = 3950; +my $errcode; +my($errmsg, $addinfo) = ("dummy", "dummy"); + +my $conn = Net::Z3950::ZOOM::ZOOM_connection_new($host, $port); +if (($errcode = Net::Z3950::ZOOM::ZOOM_connection_error($conn, $errmsg, $addinfo)) != 0) { + die("Can't connect to host '$host', port '$port': ", + "errcode='$errcode', errmsg='$errmsg', addinfo='$addinfo'"); +} + +my $query = '@attr 1=4 taylor'; +my $rs = Net::Z3950::ZOOM::ZOOM_connection_search_pqf($conn, $query); +if (($errcode = Net::Z3950::ZOOM::ZOOM_connection_error($conn, $errmsg, $addinfo)) != 0) { + die("Can't search for '$query': ", + "errcode='$errcode', errmsg='$errmsg', addinfo='$addinfo'"); +} + +print STDERR "Result count: ", Net::Z3950::ZOOM::ZOOM_resultset_size($rs), "\n"; +Net::Z3950::ZOOM::ZOOM_resultset_destroy($rs); +Net::Z3950::ZOOM::ZOOM_connection_destroy($conn); diff --git a/t/ZOOM.t b/t/ZOOM.t deleted file mode 100644 index a253209..0000000 --- a/t/ZOOM.t +++ /dev/null @@ -1,36 +0,0 @@ -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl ZOOM.t' - -######################### - -# change 'tests => 1' to 'tests => last_test_to_print'; - -use Test::More tests => 1; -BEGIN { use_ok('ZOOM') }; - -######################### - -# Insert your test code below, the Test::More module is use()ed here so read -# its man page ( perldoc Test::More ) for help writing this test script. - -my $host = "localhost"; -my $port = 3950; -my $errcode; -my($errmsg, $addinfo) = ("dummy", "dummy"); - -my $conn = ZOOM::ZOOM_connection_new($host, $port); -if (($errcode = ZOOM::ZOOM_connection_error($conn, $errmsg, $addinfo)) != 0) { - die("Can't connect to host '$host', port '$port': ", - "errcode='$errcode', errmsg='$errmsg', addinfo='$addinfo'"); -} - -my $query = '@attr 1=4 taylor'; -my $rs = ZOOM::ZOOM_connection_search_pqf($conn, $query); -if (($errcode = ZOOM::ZOOM_connection_error($conn, $errmsg, $addinfo)) != 0) { - die("Can't search for '$query': ", - "errcode='$errcode', errmsg='$errmsg', addinfo='$addinfo'"); -} - -print STDERR "Result count: ", ZOOM::ZOOM_resultset_size($rs), "\n"; -ZOOM::ZOOM_resultset_destroy($rs); -ZOOM::ZOOM_connection_destroy($conn);