From: Vincent Pit Date: Thu, 28 Aug 2008 14:48:47 +0000 (+0200) Subject: Test for an odd number of arguments X-Git-Tag: v0.02~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=2eb9d5be03064d80f409fe0e56b2bbf8905e61fb;p=perl%2Fmodules%2Fsubs-auto.git Test for an odd number of arguments --- diff --git a/t/05-args.t b/t/05-args.t index fa0e191..d449b73 100644 --- a/t/05-args.t +++ b/t/05-args.t @@ -3,10 +3,13 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 8; my $invalid = qr/Invalid\s+package\s+name/; +eval "use subs::auto qw/a b c/"; +like($@, qr|Optional\s+arguments\s+must\s+be\s+passed\s+as\s+keys?\s*/\s*values?\s+pairs?|, 'no even number of args'); + eval "use subs::auto in => \\( q{foo::bar} )"; like($@, $invalid, 'no ref as package name');