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 SUSE:SLE-15-SP6:GA
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout SUSE:SLE-15-SP7:Update/perl-Test-Simple && cd $_
- Create Badge
Source Files
Filename | Size | Changed |
---|---|---|
Test-Simple-1.302198.tar.gz | 0000335178 327 KB | |
cpanspec.yml | 0000000526 526 Bytes | |
perl-Test-Simple.changes | 0000047852 46.7 KB | |
perl-Test-Simple.spec | 0000002042 1.99 KB |
Latest Revision
Update apache2 to 2.4.58 (jsc#PED-6739) - updated to 1.302198 see /usr/share/doc/packages/perl-Test-Simple/Changes 1.302198 2023-11-30 10:07:14-08:00 America/Los_Angeles - Remove use of defined-or operator 1.302197 2023-11-28 17:30:37-08:00 America/Los_Angeles - Add ability to attach timestamps to trace objects via api or env var - updated to 1.302196 see /usr/share/doc/packages/perl-Test-Simple/Changes 1.302196 2023-10-24 10:27:33-07:00 America/Los_Angeles - Fix #882 - Fix handling of VSTRING and LVALUE refs in is_deeply() #918 - Merge several doc fixes from mauke - updated to 1.302195 see /usr/share/doc/packages/perl-Test-Simple/Changes 1.302195 2023-04-28 05:55:54-07:00 America/Los_Angeles - Fix done_testing(0) producing 2 plans and an incorrect message - updated to 1.302194 see /usr/share/doc/packages/perl-Test-Simple/Changes 1.302194 2023-03-13 20:06:57-07:00 America/Los_Angeles - Fix failing test on 5.10 - updated to 1.302193 see /usr/share/doc/packages/perl-Test-Simple/Changes 1.302193 2023-03-06 09:38:00-08:00 America/Los_Angeles - Deprecate inst't() - updated to 1.302192
Comments 0