Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT #103034: correct file names in backtraces
  • Loading branch information
moritz committed Jan 12, 2013
1 parent b1cba00 commit faa03a3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion integration/error-reporting.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 13;
plan 16;

BEGIN { @*INC.push('t/spec/packages') };

Expand Down Expand Up @@ -122,4 +122,18 @@ is_run 'die "foo"; END { say "end run" }',
'correct line number reported for assignment to non-variable';
}

# RT #103034
{
use lib 't/spec/packages';
use Foo;
try dies();
ok $!, 'RT 103034 -- died';
my $bt = $!.backtrace;
ok any($bt>>.file) ~~ /Foo\.pm/, 'found original file name in the backtrace';
# note that fudging can change the file extension, so don't check
# for .t here
ok any($bt>>.file) ~~ /'error-reporting'\./, 'found script file name in the backtrace';

}

# vim: ft=perl6
1 change: 1 addition & 0 deletions packages/Foo.pm
Expand Up @@ -6,3 +6,4 @@ class Foo;
method foo { "foo" }

sub ucfirst($thing) is export(:DEFAULT) { 'overridden ucfirst' } #OK not used
sub dies() is export { die 'Death from class Foo' }

0 comments on commit faa03a3

Please sign in to comment.