Skip to content

Commit

Permalink
Test error and presence of backtrace for return in mainline
Browse files Browse the repository at this point in the history
  • Loading branch information
skids committed Jul 25, 2015
1 parent fe6e70f commit 29aa880
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion integration/error-reporting.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 20;
plan 21;

use lib 't/spec/packages';

Expand Down Expand Up @@ -171,4 +171,11 @@ is_run 'sub s1 { sub s2 { fail("foo"); }; s2()(); }; s1();', {
err => rx/sub\ss2.*sub\ss1.*thrown<-[s]>+sub\ss1/
}, "Thrown Failure outputs dual backtraces";

# see http://irclog.perlgeek.de/perl6/2015-07-24#i_10947364 and commit c683fe9
is_run 'sub foo { ({a=>1,b=>2}, {c=>3,d=>4}).map({ if (.<a>) {return $_} else { return } }) }; say foo', {
err => rx:i/Attempt\sto\sreturn\soutside\N+Routine.*in\sblock/
}, "Correct error and a backtrace for return in mainline code";



# vim: ft=perl6

0 comments on commit 29aa880

Please sign in to comment.