This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/op/caller.t: tests for RT #7165
authorDan Collins <dcollinsn@gmail.com>
Mon, 4 Jul 2016 16:15:32 +0000 (12:15 -0400)
committerYves Orton <demerphq@gmail.com>
Fri, 21 Oct 2016 07:09:43 +0000 (09:09 +0200)
t/op/caller.t

index 969c3bd..3017465 100644 (file)
@@ -5,7 +5,7 @@ BEGIN {
     chdir 't' if -d 't';
     require './test.pl';
     set_up_inc('../lib');
-    plan( tests => 96 ); # some tests are run in a BEGIN block
+    plan( tests => 97 ); # some tests are run in a BEGIN block
 }
 
 my @c;
@@ -333,6 +333,22 @@ sub dbdie {
 END
     "caller should not SEGV for eval '' stack frames";
 
+TODO: {
+    local $::TODO = 'RT #7165: line number should be consistent for multiline subroutine calls';
+    fresh_perl_is(<<'EOP', "6\n9\n", {}, 'RT #7165: line number should be consistent for multiline subroutine calls');
+      sub tagCall {
+        my ($package, $file, $line) = caller;
+        print "$line\n";
+      }
+      
+      tagCall
+      "abc";
+      
+      tagCall
+      sub {};
+EOP
+}
+
 $::testing_caller = 1;
 
 do './op/caller.pl' or die $@;