Skip to content

Commit 1a0622e

Browse files
fix test to accomodate alternate directory separates e.g. on win32
1 parent 4f4db03 commit 1a0622e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Changes for Perl extension Test-Class
22

3+
- fix new teardown tests for MSWin32
4+
35
0.45 [2014-07-05]
46
- bump minimum required version of Test::More (RT#96951)
57

t/teardown-when-test-dies.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use strict;
44
use warnings;
55

6+
my $line;
67
{
78
package TeardownWhenTestDies;
89
use base qw(Test::Class);
@@ -11,7 +12,7 @@ use warnings;
1112
sub setup_that_runs : Test( setup => 1 ) { ok(1, "setup works"); }
1213

1314
sub my_test_method : Tests {
14-
die "oops!";
15+
BEGIN { $line = __LINE__ } die "oops!";
1516
}
1617

1718
sub teardown_that_runs : Test( teardown => 1 ) {
@@ -21,7 +22,7 @@ use warnings;
2122

2223
use Test::Builder::Tester tests => 1;
2324

24-
test_out("ok 1 - setup works\nnot ok 2 - my_test_method died (oops! at t/teardown-when-test-dies.t line 14.)\nok 3 - teardown is run");
25+
test_out("ok 1 - setup works\nnot ok 2 - my_test_method died (oops! at ${\ __FILE__ } line $line.)\nok 3 - teardown is run");
2526
test_fail( +2 );
2627
test_err( "# (in TeardownWhenTestDies->my_test_method)" );
2728
Test::Class->runtests;

0 commit comments

Comments
 (0)