Skip to content

Commit

Permalink
Add tests for RT #115390
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Jul 5, 2015
1 parent 1c5d601 commit 3957fed
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
14 changes: 13 additions & 1 deletion S14-roles/mixin.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 36;
plan 37;

# L<S14/Run-time Mixins/>

Expand Down Expand Up @@ -125,6 +125,18 @@ is $y.test, 42, 'method from other role was OK too';
is ?$a, Bool::True, 'RT #100782 2/2';
}

# RT 115390
{
my $rt115390 = 0;
for 1..1000 -> $i {
$rt115390 += $i.perl;
my $error = (my $val = (^10).pick(3).min but !$val);
1
}
is $rt115390, 500500,
'no crash with mixin in loop when it is not the last statement in loop';
}

# RT #79866
{
my $x = 42 but role { method postcircumfix:<( )>($arg) { self * $arg[0] } };
Expand Down
20 changes: 19 additions & 1 deletion S29-os/system.t
Expand Up @@ -4,7 +4,7 @@ use Test;
# L<S29/"OS"/"=item run">
# system is renamed to run, so link there.

plan 6;
plan 8;

my $res;

Expand All @@ -30,6 +30,24 @@ ok(!$res, "run() to a nonexisting program with an argument list does not die (an
'qx{} does not capture stderr';
}

# RT #115390
{
my $rt115390;
for 1..100 -> $i {
$rt115390 += $i.perl;
run "true";
1;
}
is $rt115390, 5050, 'no crash with run() in loop; run() in sink context';
$rt115390 = 0;
for 1..100 -> $i {
$rt115390 += $i.perl;
my $var = run "true";
1;
}
is $rt115390, 5050, 'no crash with run() in loop; run() not in sink context';
}

# all these tests feel like bogus, what are we testing here???
chdir "t";
my $cwd;
Expand Down

0 comments on commit 3957fed

Please sign in to comment.