From: Lukas Mai Date: Sun, 28 Feb 2010 22:27:02 +0000 (+0100) Subject: add tests for stricter import list checks X-Git-Tag: v0.04~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2a5e8ebeb600c2b4805936bd3a70acfa4d8e160d;p=p5sagit%2FFunction-Parameters.git add tests for stricter import list checks --- diff --git a/t/rename.t b/t/rename.t index d655577..e35c5b0 100644 --- a/t/rename.t +++ b/t/rename.t @@ -8,4 +8,12 @@ my $add = f ($x, $y) { $x + $y }; is $add->(2, 4), 6; +ok !eval { Function::Parameters->import('g', 'h'); 1 }; +like $@, qr/ is not exported /; + +for my $kw ('', '42', 'A::B', 'a b') { + ok !eval{ Function::Parameters->import($kw); 1 }; + like $@, qr/valid identifier /; +} + done_testing;