Skip to content

Commit

Permalink
Add test for RT #120397
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Mar 11, 2015
1 parent 6c3d4d7 commit 25f2964
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion S04-declarations/my.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 88;
plan 89;

#L<S04/The Relationship of Blocks and Declarations/"declarations, all
# lexically scoped declarations are visible">
Expand Down Expand Up @@ -337,4 +337,26 @@ eval_lives_ok 'multi f(@a) { }; multi f(*@a) { }; f(my @a = (1, 2, 3))',
is my sub {42}(), 42, 'can call postcircumfix () on subs inside my'
}

# RT #120397
## this is only meant as a test for a NullPointerException
## (or a segfault which would abort the test)
## TODO: replace with a more specific test when the syntax
## is either implemented or forbidden
{
my $exception = 'unset';
{
EVAL q[my $a ($b, $c); $b = 42];
CATCH {
when /NullPointerException/ {
$exception = 'NullPointerException';
}
default {
$exception = $_.WHAT;
}
}
}
isnt $exception, 'NullPointerException',
'no NullPointerException (and no segfault either)';
}

# vim: ft=perl6

0 comments on commit 25f2964

Please sign in to comment.