syphilis has asked for the wisdom of the Perl Monks concerning the following question:
And here's the output I get on Win32, perl-5.10.0:package MyTest; use warnings; use base q{Test::Class}; use Test::More 'no_plan'; sub DEMO_1 : Tests { my $self = shift; $self->builder->skip('Wanting to skip the DEMO_1 tests'); my $results = { '1 / 2' => "0.5", '1 / 4' => 0.25, }; _verify($results); } sub DEMO_2 : Tests { my $results = { '1 / 8' => "0.125", '1 / 16' => 0.0625, }; _verify($results); } Test::Class->runtests; sub _verify { my $results = shift; for(keys(%$results)) { ok( eval($_) == $results->{$_}, "$_ == $results->{$_}"); } }
Now that's not quite what I intend. To begin with, the $self->builder->skip('Wanting to skip the DEMO_1 tests'); seems to be treated as a test (that passes) in itself. I'm not so concerned about that. What does concern me is that the 2 tests that I want to skip (namely, the 2 tests in sub DEMO_1) are still being run.ok 1 # skip Wanting to skip the DEMO_1 tests ok 2 - 1 / 4 == 0.25 ok 3 - 1 / 2 == 0.5 ok 4 - 1 / 8 == 0.125 ok 5 - 1 / 16 == 0.0625 1..5
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::Builder::skip() not dwimming.
by massa (Hermit) on Sep 03, 2008 at 08:52 UTC | |
by syphilis (Archbishop) on Sep 03, 2008 at 10:25 UTC | |
by chromatic (Archbishop) on Sep 03, 2008 at 17:58 UTC | |
by syphilis (Archbishop) on Sep 04, 2008 at 01:12 UTC | |
by Anonymous Monk on Sep 03, 2008 at 10:42 UTC | |
by syphilis (Archbishop) on Sep 03, 2008 at 10:55 UTC | |
|
Re: Test::Builder::skip() not dwimming.
by Anonymous Monk on Sep 03, 2008 at 10:50 UTC | |
by syphilis (Archbishop) on Sep 03, 2008 at 11:18 UTC | |
by chromatic (Archbishop) on Sep 03, 2008 at 18:01 UTC |