File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -211,37 +211,6 @@ Adding C<plan> gives a true picture of the test:
211
211
Note that leaving the C < done-testing > in place will have no effect on the new test
212
212
results, but it should be removed for clarity.
213
213
214
- It is recommended that the C < done-testing > function be removed and replaced
215
- with a valid C < plan > function when all tests are finalized. Use of C < plan > can help
216
- detect test failures otherwise not reported because tests were accidentally skipped
217
- due to bugs in the tests or bugs in the compiler. For example:
218
-
219
- sub do-stuff {@};
220
- use Test;
221
- ok .is-prime for do-stuff;
222
- done-testing;
223
-
224
- # output:
225
- 1..0
226
-
227
- The above example is where a naive C < done-testing > fails. C < do-stuff() > returned
228
- nothing and tested nothing, even though it should've returned results to test. But
229
- the test suite doesn't know how many tests were meant to be run, so it passes.
230
-
231
- Adding C < plan > gives a true picture of the test:
232
-
233
- sub do-stuff {@};
234
- use Test;
235
- plan 1;
236
- ok .is-prime for do-stuff;
237
-
238
- # output:
239
- 1..1
240
- # Looks like you planned 1 test, but ran 0
241
-
242
- Note that leaving the C < done-testing > in place will have no effect on the new test
243
- results, but it should be removed for clarity.
244
-
245
214
= head1 Testing return values
246
215
247
216
The C < Test > module exports various functions that check the return value of a
You can’t perform that action at this time.
0 commit comments