Skip to content

Instantly share code, notes, and snippets.

@yuuki
Created July 13, 2013 17:43
Show Gist options
  • Select an option

  • Save yuuki/5991547 to your computer and use it in GitHub Desktop.

Select an option

Save yuuki/5991547 to your computer and use it in GitHub Desktop.
__PACKAGE__->builder->reset; いれると直る...
package MyTest;
use utf8;
use strict;
use warnings;
use parent qw(Test::Class);
use Test::More;
sub t1 : Tests {
subtest 'is it ok if I die?' => sub {
die "I'l die";
};
}
sub t2 : Tests {
__PACKAGE__->builder->reset;
subtest 'okokokok!!!' => sub {
ok 1;
};
}
__PACKAGE__->runtests();
__END__
prove test.t
test.t .. #
# MyTest->t1
# Child (is it ok if I die?) exited without calling finalize()
not ok 1 - is it ok if I die?
not ok 2 - t1 died (I'l die at test.t line 11.)
# Failed test 'is it ok if I die?'
# at /Users/yuuki/.plenv/versions/5.14.4/lib/perl5/site_perl/5.14.4/Test/Class.pm line 289.
# (in MyTest->t1)
# Failed test 't1 died (I'l die at test.t line 11.)'
# at test.t line 22.
# (in MyTest->t1)
#
# MyTest->t2
ok 1 - t2
1..1
ok 1 - okokokok!!!
# Tests were run but no plan was declared and done_testing() was not seen.
Failed 2/3 subtests
Test Summary Report
-------------------
test.t (Wstat: 0 Tests: 3 Failed: 2)
Failed tests: 1-2
Parse errors: Tests out of sequence. Found (1) but expected (3)
No plan found in TAP output
Files=1, Tests=3, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.03 cusr 0.00 csys = 0.07 CPU)
Result: FAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment