Basic utilities for writing tests
This is an extremely simple, extremely basic module for writing tests
suitable for CPAN modules and other pursuits. If you wish to do more
complicated testing, use the Test::More module (a drop-in replacement for
this one).
The basic unit of Perl testing is the ok. For each thing you want to test
your program will print out an "ok" or "not ok" to indicate pass or fail.
You do this with the ok() function (see below).
The only other constraint is you must pre-declare how many tests you plan
to run. This is in case something goes horribly wrong during the test and
your test program aborts, or skips a test or whatever.
Test::Simple will start by printing number of tests run in the form "1..M"
(so "1..5" means you're going to run 5 tests). This strange format lets
Test::Harness know how many tests you plan on running in case something
goes horribly wrong.
If all your tests passed, Test::Simple will exit with zero (which is
normal). If anything failed it will exit with how many failed. If you run
less (or more) tests than you planned, the missing (or extras) will be
considered failures. If no tests were ever run Test::Simple will throw a
warning and exit with 255. If the test died, even after having successfully
completed all its tests, it will still be considered a failure and will
exit with 255.
This module is by no means trying to be a complete testing system. It's
just to get you started. Once you're off the ground its recommended you
look at the Test::More manpage.
- Sources inherited from project openSUSE:Factory:Rings:1-MinimalX
- Links to openSUSE:Factory / perl-Test-Simple
- Has a link diff
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout openSUSE:Factory:ARM:Rings:1-MinimalX/perl-Test-Simple && cd $_
- Create Badge
Source Files (show unmerged sources)
Filename | Size | Changed |
---|---|---|
Test-Simple-1.302201.tar.gz | 0000570972 558 KB | |
cpanspec.yml | 0000000526 526 Bytes | |
perl-Test-Simple.changes | 0000049041 47.9 KB | |
perl-Test-Simple.spec | 0000002128 2.08 KB |
Comments 0