schwern/test-more — Issue #247: Warning in skip when not specifying $how_many
Author: fangly
Created: 2011-12-15 07:02:35+00:00
State: open

Hi,

The documentation of Test::More 0.9.8 specifies that:
* 1/ done_testing is safer than and replaces the "no_plan" plan.
* 2/ In skip(), if your plan is no_plan $how_many is optional and will default to 1.

However, when using done_testing() and not specifying a $how_many value to skip(), a warning message is issued:
```
Use of uninitialized value in string eq at /usr/share/perl/5.14/Test/More.pm line 1240.
skip() needs to know $how_many tests are in the block at ./test.pl line 5
```

This behavior can easily be reproduced by running this code:
```
use strict;
use warnings;
use Test::More;

SKIP: {
skip 'Skipping this test' if 1;
my $var = 'abc';
is $var, 'abc';
}

done_testing;
```

As per the documentation, this should not generate any warning message.

Best,

Florent