Skip to content

Commit 5a51785

Browse files
committed
Merge pull request #564 from tbrowder/test-skip
add an example output for 'todo'; add notes about 'skip' and 'skip-te…
2 parents 7bb0eff + fcc8e00 commit 5a51785

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

doc/Language/testing.pod

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,15 @@ only one test will be marked TODO.
410410
is my-custom-pi(), pi, 'my-custom-pi'; # Run the test, but don't report
411411
# failure in test harness.
412412
413+
The result from the test code above will be something like:
414+
415+
not ok 1 - my-custom-pi# TODO not yet precise enough
416+
417+
# Failed test 'my-custom-pi'
418+
# at test-todo.t line 7
419+
# expected: '3.14159265358979'
420+
# got: '3'
421+
413422
=item X<skip($reason, $count = 1)|skip>
414423
415424
Skip C<$count> tests, giving a C<$reason> as to why. By default only one
@@ -426,6 +435,9 @@ else {
426435
}
427436
=end code
428437
438+
Note that if you mark a test as skipped, you must also prevent that
439+
test from running.
440+
429441
=item X<skip-rest($reason?)|skip-rest>
430442
431443
Skip the remaining tests. If the remainder of the tests in the test file
@@ -446,7 +458,10 @@ ok womble();
446458
Note that C<skip-rest> requires a C<plan> to be set, otherwise the
447459
C<skip-rest> call will throw an error. If no plan was set, you can use
448460
C<done> to indicate the end of the test run (though of course the test
449-
summary will not count skipped tests).
461+
summary will not count skipped tests). Note also the C<exit> is
462+
required in the example to prevent the skipped tests from running.
463+
Alternatively, you could enclose the remaining tests in an C<else>
464+
branch.
450465
451466
=head1 Manual control
452467

0 commit comments

Comments
 (0)