Lines Matching full:tests

3 Test::Tutorial - A tutorial about writing really basic tests
10 me write tests!>
17 Is this you? Is writing tests right up there with writing
55 use Test::Simple tests => 1;
66 use Test::Simple tests => 2;
76 # Looks like you failed 1 tests of 2.
78 C<1..2> "I'm going to run two tests." This number is a I<plan>. It helps to
80 tests. C<ok 1> "The first test passed." C<not ok 2> "The second test failed".
81 Test::Simple helpfully prints out some extra commentary about your tests.
103 use Test::Simple tests => 2;
122 That output isn't terribly descriptive, is it? When you have two tests you can
123 figure out which one is #2, but what if you have 102 tests?
128 use Test::Simple tests => 2;
148 use Test::Simple tests => 8;
177 # Looks like you failed 1 tests of 8.
196 use Test::More tests => 8;
228 # Looks like you failed 1 tests of 8.
232 when writing the tests. Change it to:
245 =head2 Sometimes the tests are wrong
247 This brings up a very important lesson. Code has bugs. Tests are
248 code. Ergo, tests have bugs. A failing test could mean a bug in the
265 use Test::More tests => 32;
300 the C<< use Test::More tests => ## >> line. That can rapidly get
313 # For each key in the hash we're running 8 tests.
314 plan tests => keys(%ICal_Dates) * 8;
316 ...and then your tests...
319 running some tests, don't know how many. [6]
321 use Test::More; # instead of tests => 32
323 ... # tests here
329 C<done_testing()> an optional number of tests you expected to run, and if the
355 Describe what the tests test, to make debugging a failed test easier
359 =head2 Skipping tests
361 Poking around in the existing L<Date::ICal> tests, I found this in
366 use Test::More tests => 7;
380 # like the tests above, but starting with ical instead of epoch
393 use Test::More tests => 7;
410 # like the tests above, but starting with ical instead of epoch
418 the tests run normally. But when on MacOS, C<skip()> causes the entire
420 C<skip()> prints special output that tells L<Test::Harness> that the tests have
432 This means your tests won't fail on MacOS. This means fewer emails
433 from MacPerl users telling you about failing tests that you know will
434 never work. You've got to be careful with skip tests. These are for
435 tests which don't work and I<never will>. It is not for skipping
438 The tests are wholly and completely skipped. [10] This will work.
447 =head2 Todo tests
461 use Test::More tests => 1;
475 # Looks like you failed 1 tests of 1.
482 use Test::More tests => 1;
500 L<Test::More> doesn't say "Looks like you failed 1 tests of 1". That '#
502 failure as a successful test. You can write tests even before
519 It's very simple to have your tests run under taint mode. Just throw
521 in C<#!> and use them to run your tests.
542 some bugs, which is good -- we'll uncover them with our tests.
547 itself. Have a look at L<Test::Inline> (formerly L<Pod::Tests>).
560 didn't say how many tests we're going to run, how can we know it
588 Do NOT be tempted to use TODO tests as a way to avoid fixing simple