diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-24 18:59:47 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-24 19:14:25 -0800 |
commit | d8cf01c3fd9038b24af3eaa18e15b6d872af6644 (patch) | |
tree | 63d46e3636d0042c1b79089c13d1d09f47f213de /dist | |
parent | dff5ffe48973403ad9fd15472a494ceb8a4df109 (diff) | |
download | perl-d8cf01c3fd9038b24af3eaa18e15b6d872af6644.tar.gz |
deparse.t: Automatically count __DATA__ tests
I didn’t know that done_testing could take an argument. This elimi-
nates the manual fiddling of the test count every time a test is added
to __DATA__. For other tests, which are the exception, we still have
the safety of a test count to make sure the tests actually run.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/B-Deparse/t/deparse.t | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index b56978bfe4..f050faabfc 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -20,7 +20,7 @@ BEGIN { use Test::More; use Config (); -plan tests => 130; +my $tests = 17; # not counting those in the __DATA__ section use B::Deparse; my $deparse = B::Deparse->new(); @@ -39,6 +39,7 @@ isa_ok($deparse, 'B::Deparse', 'instantiate a B::Deparse object'); $/ = "\n####\n"; while (<DATA>) { chomp; + $tests ++; # This code is pinched from the t/lib/common.pl for TODO. # It's not clear how to avoid duplication # Now tweaked a bit to do skip or todo @@ -248,7 +249,7 @@ SKIP: { `; } -done_testing(); +done_testing($tests); __DATA__ # A constant |