From e84c379dca5e0b62e80c9e57b84e5cbf6f802a0a Mon Sep 17 00:00:00 2001 From: mike Date: Thu, 6 Apr 2006 12:50:19 +0000 Subject: [PATCH] New --- t/19-events.t | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 t/19-events.t diff --git a/t/19-events.t b/t/19-events.t new file mode 100644 index 0000000..690fcff --- /dev/null +++ b/t/19-events.t @@ -0,0 +1,35 @@ +# $Id: 19-events.t,v 1.1 2006-04-06 12:50:19 mike Exp $ + +# Before `make install' is performed this script should be runnable with +# `make test'. After `make install' it should work as `perl 19-events.t' + +use strict; +use warnings; +use Test::More tests => 7; + +BEGIN { use_ok('Net::Z3950::ZOOM') }; + +my($errcode, $errmsg, $addinfo) = (undef, "dummy", "dummy"); + +my $host = "indexdata.com/gils"; +my $conn = Net::Z3950::ZOOM::connection_new($host, 0); +$errcode = Net::Z3950::ZOOM::connection_error($conn, $errmsg, $addinfo); +ok($errcode == 0, "connection to '$host'"); + +#my $options = Net::Z3950::ZOOM::options_create(); +my $val = Net::Z3950::ZOOM::event(1); +ok($val == -1, "non-reference argument rejected"); + +$val = Net::Z3950::ZOOM::event($conn); +ok($val == -2, "non-array reference argument rejected"); + +$val = Net::Z3950::ZOOM::event([]); +ok($val == -3, "empty array reference argument rejected"); + +$val = Net::Z3950::ZOOM::event([1..32767]); +ok($val == -4, "huge array reference argument rejected"); + +$val = Net::Z3950::ZOOM::event([$conn]); +ok($val == 0, "call with single connection does nothing"); + +### Now we need to actually do something. -- 1.7.10.4