Permalink
Browse files

[t/spec] Tests for RT #64844

git-svn-id: http://svn.pugscode.org/pugs@27861 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 9beb7c7 commit 8efee976f7b5a2633d97840484eeee23b03fcc4d kyle committed Aug 3, 2009
Showing with 20 additions and 1 deletion.
  1. +20 −1 S02-builtin_data_types/anon_block.t
@@ -11,7 +11,7 @@ This covers anonymous blocks and subs, as well as pointy blocks
=end description
-plan 31;
+plan 34;
# L<S04/"The Relationship of Blocks and Declarations">
# L<S06/"Anonymous subroutines">
@@ -30,6 +30,25 @@ my $anon_block = { 1 };
isa_ok($anon_block, Block);
is($anon_block(), 1, '{} <anon block> works');
+# RT #64844
+{
+ eval '$anon_block( 1 )';
+ #?rakudo todo 'Parrot support for zero-arg subs?'
+ ok $! ~~ Exception, 'too many parameters';
+
+ if $! !~~ Exception {
+ skip 2, q{tests don't work if previous test fails};
+ }
+ else {
+ my $errmsg = ~$!;
+
+ eval '$anon_block( foo => "RT #64844" )';
+ ok $! ~~ Exception, 'too many parameters';
+ #?rakudo todo 'RT #64844'
+ is ~$!, $errmsg, 'same error for named param as positional';
+ }
+}
+
# L<S06/""Pointy blocks"">
{
# pointy subs

0 comments on commit 8efee97

Please sign in to comment.