1 |
# -*- Mode: Perl -*- |
2 |
# $Basename: client.t $ |
3 |
# $Revision: 1.2 $ |
4 |
# Author : Ulrich Pfeifer |
5 |
# Created On : Fri Jan 31 16:34:58 1997 |
6 |
# Last Modified By: Ulrich Pfeifer |
7 |
# Last Modified On: Wed Nov 5 16:44:56 1997 |
8 |
# Language : CPerl |
9 |
# Update Count : 18 |
10 |
# Status : Unknown, Use with caution! |
11 |
# |
12 |
# (C) Copyright 1997, Ulrich Pfeifer, all rights reserved. |
13 |
# |
14 |
# |
15 |
|
16 |
BEGIN { $| = 1; print "1..8\n"; } |
17 |
END {print "not ok 1\n" unless $loaded;} |
18 |
use WAIT::Client; |
19 |
|
20 |
$loaded = 1; |
21 |
print "ok 1\n"; |
22 |
my $test = 2; |
23 |
|
24 |
$SIG{ALRM} = |
25 |
sub { |
26 |
print "Cannot connect to ls6.informatik.uni-dortmund.de\n"; |
27 |
print "# skipping tests 10..15\n"; |
28 |
for ($test .. 8) {print "ok $_\n";} |
29 |
exit 0; |
30 |
}; |
31 |
|
32 |
|
33 |
alarm(10); |
34 |
my $con = new WAIT::Client 'ls6.informatik.uni-dortmund.de', Port => 1404; |
35 |
print "not " unless $con; print "ok $test\n"; $test++; |
36 |
exit unless $con; |
37 |
alarm(0); |
38 |
$status = $con->help(); |
39 |
print "not " unless $status; print "ok $test\n"; $test++; |
40 |
|
41 |
$status = $con->database('DB'); |
42 |
print "not " unless $status; print "ok $test\n"; $test++; |
43 |
|
44 |
$status = $con->table('cpan'); |
45 |
print "not " unless $status; print "ok $test\n"; $test++; |
46 |
|
47 |
$status = $con->hits(3); |
48 |
print "not " unless $status; print "ok $test\n"; $test++; |
49 |
|
50 |
$status = $con->search(qw(au=wall and au=larry)); |
51 |
print "not " unless $status; print "ok $test\n"; $test++; |
52 |
|
53 |
$status = $con->info(1); |
54 |
print "not " unless $status; print "ok $test\n"; $test++; |
55 |
|