summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2013-03-27 19:06:50 -0700
committerRuss Allbery <rra@stanford.edu>2013-03-27 19:06:50 -0700
commit0069601d0dae535c2c0848a408bc5ecf349f7945 (patch)
tree7391a4bf551a3adb86242fdcadcb17ebe68e9879
parent6d4d689361c29528cf92bc10750e260d48529b69 (diff)
parent945608173ffc08cd1351433100dcc869aa6dafb1 (diff)
Imported Upstream version 1.0
-rwxr-xr-xserver/wallet-backend2
-rwxr-xr-xtests/server/backend-t17
2 files changed, 12 insertions, 7 deletions
diff --git a/server/wallet-backend b/server/wallet-backend
index fc3434e..3c87709 100755
--- a/server/wallet-backend
+++ b/server/wallet-backend
@@ -195,7 +195,7 @@ sub command {
print $status ? "yes\n" : "no\n";
}
} elsif ($command eq 'comment') {
- check_args (2, 3, [], @args);
+ check_args (2, 3, [3], @args);
if (@args > 2) {
$server->comment (@args) or failure ($server->error, @_);
} else {
diff --git a/tests/server/backend-t b/tests/server/backend-t
index 50131b7..7e9287d 100755
--- a/tests/server/backend-t
+++ b/tests/server/backend-t
@@ -3,7 +3,7 @@
# Tests for the wallet-backend dispatch code.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
+# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
@@ -283,11 +283,16 @@ for my $command (sort keys %commands) {
my @args = @base;
$args[$arg] = 'foo;bar';
($out, $err) = run_backend ($command, @args);
- if ($command eq 'store' and $arg == 2) {
- is ($err, '', 'Store allows any characters');
- is ($OUTPUT, "command $command @args[0,1] from admin (1.2.3.4)"
- . " succeeded\n", ' and success logged');
- is ($out, "$new\nstore foobar foobar foo;bar\n",
+ if (($command eq 'store' or $command eq 'comment') and $arg == 2) {
+ is ($err, '', 'Store and comment allow any characters');
+ if ($command eq 'store') {
+ is ($OUTPUT, "command $command @args[0,1] from admin"
+ . " (1.2.3.4) succeeded\n", ' and success logged');
+ } else {
+ is ($OUTPUT, "command $command @args from admin"
+ . " (1.2.3.4) succeeded\n", ' and success logged');
+ }
+ is ($out, "$new\n$command foobar foobar foo;bar\n",
' and calls the right method');
} else {
is ($err, "invalid characters in argument: foo;bar\n",