aboutsummaryrefslogtreecommitdiff
path: root/perl/t
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-02-07 01:44:28 +0000
committerRuss Allbery <rra@stanford.edu>2008-02-07 01:44:28 +0000
commit428c88bb0a08ba2eb06c7f5181f7cbee2f7ee398 (patch)
treee825ea00b3ceb0074bbd8183ea16fceafb6c135d /perl/t
parente733132938bc4fc74584b9a7c0f5441eb640e617 (diff)
Add a check command to the wallet server to determine whether an object
already exists.
Diffstat (limited to 'perl/t')
-rwxr-xr-xperl/t/server.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/perl/t/server.t b/perl/t/server.t
index 39e1090..f732af3 100755
--- a/perl/t/server.t
+++ b/perl/t/server.t
@@ -8,7 +8,7 @@
#
# See LICENSE for licensing terms.
-use Test::More tests => 334;
+use Test::More tests => 338;
use POSIX qw(strftime);
use Wallet::Admin;
@@ -172,9 +172,12 @@ is ($server->create ('base', 'service/admin'), 1,
is ($server->create ('base', 'service/admin'), undef, ' but not twice');
like ($server->error, qr{^cannot create object base:service/admin: },
' and returns the right error');
+is ($server->check ('base', 'service/admin'), 1, ' and check works');
is ($server->create ('srvtab', 'service.admin'), undef,
'Creating an unknown object fails');
is ($server->error, 'unknown object type srvtab', ' with the right error');
+is ($server->check ('srvtab', 'service.admin'), undef, ' and check fails');
+is ($server->error, 'unknown object type srvtab', ' with the right error');
is ($server->create ('', 'service.admin'), undef,
' and likewise with an empty type');
is ($server->error, 'unknown object type ', ' with the right error');
@@ -193,6 +196,8 @@ is ($server->destroy ('srvtab', 'service/test'), undef,
is ($server->error, 'unknown object type srvtab', ' with a different error');
is ($server->destroy ('base', 'service/test'), 1,
' but destroying a good object works');
+is ($server->check ('base', 'service/test'), 0,
+ ' and now check says it is not there');
is ($server->destroy ('base', 'service/test'), undef, ' but not twice');
is ($server->error, 'cannot find base:service/test', ' with the right error');