From e30aae6d0ee6a19d3521fe1b9db24c6ed91a5538 Mon Sep 17 00:00:00 2001 From: Coke Date: Sat, 26 Jun 2010 22:40:26 -0400 Subject: [PATCH] improve stub for [gets] --- src/Partcl/commands/main.pm | 4 ++++ t/cmd_gets.t | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Partcl/commands/main.pm b/src/Partcl/commands/main.pm index 60c7078..ca87f67 100644 --- a/src/Partcl/commands/main.pm +++ b/src/Partcl/commands/main.pm @@ -272,6 +272,10 @@ our sub format(*@args) { } our sub gets(*@args) { + if +@args < 1 || +@args > 2 { + error('wrong # args: should be "gets channelId ?varName?"'); + } + my $channelId := @args.shift; ''; } diff --git a/t/cmd_gets.t b/t/cmd_gets.t index d61e7db..16af2d3 100755 --- a/t/cmd_gets.t +++ b/t/cmd_gets.t @@ -5,11 +5,11 @@ plan 3 eval_is {gets} \ {wrong # args: should be "gets channelId ?varName?"} \ - {no args} {TODO NQPRX} + {no args} eval_is {gets a b c} \ {wrong # args: should be "gets channelId ?varName?"} \ - {too many args} {TODO NQPRX} + {too many args} eval_is {gets #parrot} \ {can not find channel named "#parrot"} \