]> git.vpit.fr Git - perl/modules/subs-auto.git/commitdiff
Test for an odd number of arguments
authorVincent Pit <vince@profvince.com>
Thu, 28 Aug 2008 14:48:47 +0000 (16:48 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 28 Aug 2008 14:48:47 +0000 (16:48 +0200)
t/05-args.t

index fa0e1912dcc3fd76a9f27df1b2d5e12c2e48ea56..d449b7326788daed0687d16c22ca31b6507d7042 100644 (file)
@@ -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');