Browse files

Add test for invoking tests in functions

  • Loading branch information...
1 parent 0ffe02c commit 9a16b99ec5f2e4531f259ac50503df029e07c756 @hoelzro hoelzro committed Oct 3, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 t/11_failure_location.t
View
13 t/11_failure_location.t
@@ -1,13 +1,24 @@
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More tests => 2;
use Test::Builder::Tester;
use Test::SharedFork;
+sub run_test {
+ test_fail +3;
+ test_err "# got: '0'";
+ test_err "# expected: '1'";
+ is 0, 1;
+}
+
test_out 'not ok 1';
test_fail +3;
test_err "# got: '0'";
test_err "# expected: '1'";
is 0, 1;
test_test 'Failure locations should be correct';
+
+test_out 'not ok 1';
+run_test;
+test_test 'Failure locations should be correct in called test functions';

0 comments on commit 9a16b99

Please sign in to comment.