New
[ZOOM-Perl-moved-to-github.git] / t / 26-packages.t
1 # $Id: 26-packages.t,v 1.1 2005-11-08 15:56:05 mike Exp $
2
3 # Before `make install' is performed this script should be runnable with
4 # `make test'. After `make install' it should work as `perl 26-packages.t'
5
6 use strict;
7 use warnings;
8 use Test::More tests => 6;
9
10 BEGIN { use_ok('ZOOM') };
11
12 my $host = "indexdata.com/gils";
13 my $conn;
14 eval { $conn = new ZOOM::Connection($host, 0) };
15 ok(!$@, "connection to '$host'");
16
17 my $p = $conn->package();
18 # Inspection of the ZOOM-C code shows that this can never fail, in fact.
19 ok(defined $p, "created package");
20
21 # There may be useful options to set, but this is not one of them!
22 $p->option(foo => "bar");
23 my $val = $p->option("foo");
24 ok($val eq "bar", "package option retrieved as expected");
25
26 eval { $p->send("foo") };
27 ok(!$@, "sent 'foo' package");
28
29 ### Now what?
30
31 $p->destroy();
32 ok(1, "destroyed package");