Carp: avoid hardcoded lines and filenames in test
authorRicardo Signes <rjbs@cpan.org>
Thu, 19 Mar 2015 22:59:39 +0000 (18:59 -0400)
committerRicardo Signes <rjbs@cpan.org>
Thu, 19 Mar 2015 23:12:10 +0000 (19:12 -0400)
dist/Carp/t/Carp.t

index b12c482..3d707a1 100644 (file)
@@ -28,10 +28,10 @@ BEGIN {
 }
 
 {
-  my $str = Carp::longmess("foo");
+  my $line = __LINE__; my $str = Carp::longmess("foo");
   is(
     $str,
-    "foo at t/Carp.t line 31.\n",
+    "foo at $0 line $line.\n",
     "we don't overshoot the top stack frame",
   );
 }