9 # Can't use Carp because it might cause use_ok() to accidentally succeed
10 # even though the module being used forgot to use Carp. Yes, this
13 my($file, $line) = (caller(1))[1,2];
14 warn @_, " at $file line $line\n";
20 use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO);
23 @EXPORT = qw(ok use_ok require_ok
24 is isnt like unlike is_deeply
28 eq_array eq_hash eq_set
35 my $Test = Test::Builder->new;
38 # 5.004's Exporter doesn't have export_to_level.
43 (undef) = shift; # redundant arg
44 my $callpkg = caller($level);
45 $pkg->export($callpkg, @_);
51 Test::More - yet another framework for writing test scripts
55 use Test::More tests => $Num_Tests;
57 use Test::More qw(no_plan);
59 use Test::More skip_all => $reason;
61 BEGIN { use_ok( 'Some::Module' ); }
62 require_ok( 'Some::Module' );
64 # Various ways to say "ok"
65 ok($this eq $that, $test_name);
67 is ($this, $that, $test_name);
68 isnt($this, $that, $test_name);
70 # Rather than print STDERR "# here's what went wrong\n"
71 diag("here's what went wrong");
73 like ($this, qr/that/, $test_name);
74 unlike($this, qr/that/, $test_name);
76 cmp_ok($this, '==', $that, $test_name);
78 is_deeply($complex_structure1, $complex_structure2, $test_name);
81 skip $why, $how_many unless $have_some_feature;
83 ok( foo(), $test_name );
84 is( foo(42), 23, $test_name );
90 ok( foo(), $test_name );
91 is( foo(42), 23, $test_name );
94 can_ok($module, @methods);
95 isa_ok($object, $class);
100 # Utility comparison functions.
101 eq_array(\@this, \@that);
102 eq_hash(\%this, \%that);
103 eq_set(\@this, \@that);
106 my @status = Test::More::status;
114 B<STOP!> If you're just getting started writing tests, have a look at
115 Test::Simple first. This is a drop in replacement for Test::Simple
116 which you can switch to once you get the hang of basic testing.
118 The purpose of this module is to provide a wide range of testing
119 utilities. Various ways to say "ok" with better diagnostics,
120 facilities to skip tests, test future features and compare complicated
121 data structures. While you can do almost anything with a simple
122 C<ok()> function, it doesn't provide good diagnostic output.
125 =head2 I love it when a plan comes together
127 Before anything else, you need a testing plan. This basically declares
128 how many tests your script is going to run to protect against premature
131 The preferred way to do this is to declare a plan when you C<use Test::More>.
133 use Test::More tests => $Num_Tests;
135 There are rare cases when you will not know beforehand how many tests
136 your script is going to run. In this case, you can declare that you
137 have no plan. (Try to avoid using this as it weakens your test.)
139 use Test::More qw(no_plan);
141 In some cases, you'll want to completely skip an entire testing script.
143 use Test::More skip_all => $skip_reason;
145 Your script will declare a skip with the reason why you skipped and
146 exit immediately with a zero (success). See L<Test::Harness> for
149 If you want to control what functions Test::More will export, you
150 have to use the 'import' option. For example, to import everything
151 but 'fail', you'd do:
153 use Test::More tests => 23, import => ['!fail'];
155 Alternatively, you can use the plan() function. Useful for when you
156 have to calculate the number of tests.
159 plan tests => keys %Stuff * 3;
161 or for deciding between running the tests at all:
164 if( $^O eq 'MacOS' ) {
165 plan skip_all => 'Test irrelevant on MacOS';
178 $Test->exported_to($caller);
181 foreach my $idx (0..$#plan) {
182 if( $plan[$idx] eq 'import' ) {
183 my($tag, $imports) = splice @plan, $idx, 2;
184 @imports = @$imports;
191 __PACKAGE__->_export_to_level(1, __PACKAGE__, @imports);
202 By convention, each test is assigned a number in order. This is
203 largely done automatically for you. However, it's often very useful to
204 assign a name to each test. Which would you rather see:
212 ok 4 - basic multi-variable
213 not ok 5 - simple exponential
214 ok 6 - force == mass * acceleration
216 The later gives you some idea of what failed. It also makes it easier
217 to find the test in your script, simply search for "simple
220 All test functions take a name argument. It's optional, but highly
221 suggested that you use it.
224 =head2 I'm ok, you're not ok.
226 The basic purpose of this module is to print out either "ok #" or "not
227 ok #" depending on if a given test succeeded or failed. Everything
230 All of the following print "ok" or "not ok" depending on if the test
231 succeeded or failed. They all also return true or false,
238 ok($this eq $that, $test_name);
240 This simply evaluates any expression (C<$this eq $that> is just a
241 simple example) and uses that to determine if the test succeeded or
242 failed. A true expression passes, a false one fails. Very simple.
246 ok( $exp{9} == 81, 'simple exponential' );
247 ok( Film->can('db_Main'), 'set_db()' );
248 ok( $p->tests == 4, 'saw tests' );
249 ok( !grep !defined $_, @items, 'items populated' );
251 (Mnemonic: "This is ok.")
253 $test_name is a very short description of the test that will be printed
254 out. It makes it very easy to find a test in your script when it fails
255 and gives others an idea of your intentions. $test_name is optional,
256 but we B<very> strongly encourage its use.
258 Should an ok() fail, it will produce some diagnostics:
260 not ok 18 - sufficient mucus
261 # Failed test 18 (foo.t at line 42)
263 This is actually Test::Simple's ok() routine.
268 my($test, $name) = @_;
269 $Test->ok($test, $name);
276 is ( $this, $that, $test_name );
277 isnt( $this, $that, $test_name );
279 Similar to ok(), is() and isnt() compare their two arguments
280 with C<eq> and C<ne> respectively and use the result of that to
281 determine if the test succeeded or failed. So these:
283 # Is the ultimate answer 42?
284 is( ultimate_answer(), 42, "Meaning of Life" );
287 isnt( $foo, '', "Got some foo" );
289 are similar to these:
291 ok( ultimate_answer() eq 42, "Meaning of Life" );
292 ok( $foo ne '', "Got some foo" );
294 (Mnemonic: "This is that." "This isn't that.")
296 So why use these? They produce better diagnostics on failure. ok()
297 cannot know what you are testing for (beyond the name), but is() and
298 isnt() know what the test was and why it failed. For example this
301 my $foo = 'waffle'; my $bar = 'yarblokos';
302 is( $foo, $bar, 'Is foo the same as bar?' );
304 Will produce something like this:
306 not ok 17 - Is foo the same as bar?
307 # Failed test 1 (foo.t at line 139)
309 # expected: 'yarblokos'
311 So you can figure out what went wrong without rerunning the test.
313 You are encouraged to use is() and isnt() over ok() where possible,
314 however do not be tempted to use them to find out if something is
317 # XXX BAD! $pope->isa('Catholic') eq 1
318 is( $pope->isa('Catholic'), 1, 'Is the Pope Catholic?' );
320 This does not check if C<$pope->isa('Catholic')> is true, it checks if
321 it returns 1. Very different. Similar caveats exist for false and 0.
322 In these cases, use ok().
324 ok( $pope->isa('Catholic') ), 'Is the Pope Catholic?' );
326 For those grammatical pedants out there, there's an C<isn't()>
327 function which is an alias of isnt().
344 like( $this, qr/that/, $test_name );
346 Similar to ok(), like() matches $this against the regex C<qr/that/>.
350 like($this, qr/that/, 'this is like that');
354 ok( $this =~ /that/, 'this is like that');
356 (Mnemonic "This is like that".)
358 The second argument is a regular expression. It may be given as a
359 regex reference (i.e. C<qr//>) or (for better compatibility with older
360 perls) as a string that looks like a regex (alternative delimiters are
361 currently not supported):
363 like( $this, '/that/', 'this is like that' );
365 Regex options may be placed on the end (C<'/that/i'>).
367 Its advantages over ok() are similar to that of is() and isnt(). Better
368 diagnostics on failure.
379 unlike( $this, qr/that/, $test_name );
381 Works exactly as like(), only it checks if $this B<does not> match the
393 cmp_ok( $this, $op, $that, $test_name );
395 Halfway between ok() and is() lies cmp_ok(). This allows you to
396 compare two arguments using any binary perl operator.
398 # ok( $this eq $that );
399 cmp_ok( $this, 'eq', $that, 'this eq that' );
401 # ok( $this == $that );
402 cmp_ok( $this, '==', $that, 'this == that' );
404 # ok( $this && $that );
405 cmp_ok( $this, '&&', $that, 'this || that' );
408 Its advantage over ok() is when the test fails you'll know what $this
412 # Failed test (foo.t at line 12)
417 It's also useful in those cases where you are comparing numbers and
418 is()'s use of C<eq> will interfere:
420 cmp_ok( $big_hairy_number, '==', $another_big_hairy_number );
431 can_ok($module, @methods);
432 can_ok($object, @methods);
434 Checks to make sure the $module or $object can do these @methods
435 (works with functions, too).
437 can_ok('Foo', qw(this that whatever));
439 is almost exactly like saying:
441 ok( Foo->can('this') &&
446 only without all the typing and with a better interface. Handy for
447 quickly testing an interface.
449 No matter how many @methods you check, a single can_ok() call counts
450 as one test. If you desire otherwise, use:
452 foreach my $meth (@methods) {
453 can_ok('Foo', $meth);
459 my($proto, @methods) = @_;
460 my $class = ref $proto || $proto;
463 my $ok = $Test->ok( 0, "$class->can(...)" );
464 $Test->diag(' can_ok() called with no methods');
469 foreach my $method (@methods) {
470 local($!, $@); # don't interfere with caller's $@
471 # eval sometimes resets $!
472 eval { $proto->can($method) } || push @nok, $method;
476 $name = @methods == 1 ? "$class->can('$methods[0]')"
477 : "$class->can(...)";
479 my $ok = $Test->ok( !@nok, $name );
481 $Test->diag(map " $class->can('$_') failed\n", @nok);
488 isa_ok($object, $class, $object_name);
489 isa_ok($ref, $type, $ref_name);
491 Checks to see if the given $object->isa($class). Also checks to make
492 sure the object was defined in the first place. Handy for this sort
495 my $obj = Some::Module->new;
496 isa_ok( $obj, 'Some::Module' );
498 where you'd otherwise have to write
500 my $obj = Some::Module->new;
501 ok( defined $obj && $obj->isa('Some::Module') );
503 to safeguard against your test script blowing up.
505 It works on references, too:
507 isa_ok( $array_ref, 'ARRAY' );
509 The diagnostics of this test normally just refer to 'the object'. If
510 you'd like them to be more specific, you can supply an $object_name
511 (for example 'Test customer').
516 my($object, $class, $obj_name) = @_;
519 $obj_name = 'The object' unless defined $obj_name;
520 my $name = "$obj_name isa $class";
521 if( !defined $object ) {
522 $diag = "$obj_name isn't defined";
524 elsif( !ref $object ) {
525 $diag = "$obj_name isn't a reference";
528 # We can't use UNIVERSAL::isa because we want to honor isa() overrides
529 local($@, $!); # eval sometimes resets $!
530 my $rslt = eval { $object->isa($class) };
532 if( $@ =~ /^Can't call method "isa" on unblessed reference/ ) {
533 if( !UNIVERSAL::isa($object, $class) ) {
534 my $ref = ref $object;
535 $diag = "$obj_name isn't a '$class' it's a '$ref'";
539 WHOA! I tried to call ->isa on your object and got some weird error.
540 This should never happen. Please contact the author immediately.
547 my $ref = ref $object;
548 $diag = "$obj_name isn't a '$class' it's a '$ref'";
556 $ok = $Test->ok( 0, $name );
557 $Test->diag(" $diag\n");
560 $ok = $Test->ok( 1, $name );
574 Sometimes you just want to say that the tests have passed. Usually
575 the case is you've got some complicated condition that is difficult to
576 wedge into an ok(). In this case, you can simply use pass() (to
577 declare the test ok) or fail (for not ok). They are synonyms for
580 Use these very, very, very sparingly.
596 If you pick the right test function, you'll usually get a good idea of
597 what went wrong when it failed. But sometimes it doesn't work out
598 that way. So here we have ways for you to write your own diagnostic
599 messages which are safer than just C<print STDERR>.
605 diag(@diagnostic_message);
607 Prints a diagnostic message which is guaranteed not to interfere with
608 test output. Handy for this sort of thing:
610 ok( grep(/foo/, @users), "There's a foo user" ) or
611 diag("Since there's no foo, check that /etc/bar is set up right");
615 not ok 42 - There's a foo user
616 # Failed test (foo.t at line 52)
617 # Since there's no foo, check that /etc/bar is set up right.
619 You might remember C<ok() or diag()> with the mnemonic C<open() or
622 B<NOTE> The exact formatting of the diagnostic output is still
623 changing, but it is guaranteed that whatever you throw at it it won't
624 interfere with the test.
637 You usually want to test if the module you're testing loads ok, rather
638 than just vomiting if its load fails. For such purposes we have
639 C<use_ok> and C<require_ok>.
645 BEGIN { use_ok($module); }
646 BEGIN { use_ok($module, @imports); }
648 These simply use the given $module and test to make sure the load
649 happened ok. It's recommended that you run use_ok() inside a BEGIN
650 block so its functions are exported at compile-time and prototypes are
653 If @imports are given, they are passed through to the use. So this:
655 BEGIN { use_ok('Some::Module', qw(foo bar)) }
659 use Some::Module qw(foo bar);
665 my($module, @imports) = @_;
666 @imports = () unless @imports;
670 local($@,$!); # eval sometimes interferes with $!
674 '$module'->import(\@imports);
677 my $ok = $Test->ok( !$@, "use $module;" );
681 $Test->diag(<<DIAGNOSTIC);
682 Tried to use '$module'.
695 Like use_ok(), except it requires the $module.
704 local($!, $@); # eval sometimes interferes with $!
710 my $ok = $Test->ok( !$@, "require $module;" );
714 $Test->diag(<<DIAGNOSTIC);
715 Tried to require '$module'.
726 =head2 Conditional tests
728 Sometimes running a test under certain conditions will cause the
729 test script to die. A certain function or method isn't implemented
730 (such as fork() on MacOS), some resource isn't available (like a
731 net connection) or a module isn't available. In these cases it's
732 necessary to skip tests, or declare that they are supposed to fail
733 but will work in the future (a todo test).
735 For more details on the mechanics of skip and todo tests see
738 The way Test::More handles this is with a named block. Basically, a
739 block of tests which can be skipped over or made todo. It's best if I
747 skip $why, $how_many if $condition;
749 ...normal testing code goes here...
752 This declares a block of tests to skip, $how_many tests there are,
753 $why and under what $condition to skip them. An example is the
754 easiest way to illustrate:
757 skip "Pigs don't fly here", 2 unless Pigs->can('fly');
762 ok( $pig->altitude > 0, 'Pig is airborne' );
763 ok( $pig->airspeed > 0, ' and moving' );
766 If pigs cannot fly, the whole block of tests will be skipped
767 completely. Test::More will output special ok's which Test::Harness
768 interprets as skipped tests. It's important to include $how_many tests
769 are in the block so the total number of tests comes out right (unless
770 you're using C<no_plan>, in which case you can leave $how_many off if
773 It's perfectly safe to nest SKIP blocks.
775 Tests are skipped when you B<never> expect them to B<ever> pass. Like
776 an optional module is not installed or the operating system doesn't
777 have some feature (like fork() or symlinks) or maybe you need an
778 Internet connection and one isn't available.
780 You don't skip tests which are failing because there's a bug in your
781 program. For that you use TODO. Read on.
785 See L</Why are skip and todo so weird?>
791 my($why, $how_many) = @_;
793 unless( defined $how_many ) {
794 # $how_many can only be avoided when no_plan is in use.
795 _carp "skip() needs to know \$how_many tests are in the block"
796 unless $Test::Builder::No_Plan;
800 for( 1..$how_many ) {
812 local $TODO = $why if $condition;
814 ...normal testing code goes here...
817 Declares a block of tests you expect to fail and $why. Perhaps it's
818 because you haven't fixed a bug or haven't finished a new feature:
821 local $TODO = "URI::Geller not finished";
823 my $card = "Eight of clubs";
824 is( URI::Geller->your_card, $card, 'Is THIS your card?' );
827 URI::Geller->bend_spoon;
828 is( $spoon, 'bent', "Spoon bending, that's original" );
831 With a todo block, the tests inside are expected to fail. Test::More
832 will run the tests normally, but print out special flags indicating
833 they are "todo". Test::Harness will interpret failures as being ok.
834 Should anything succeed, it will report it as an unexpected success.
836 The nice part about todo tests, as opposed to simply commenting out a
837 block of tests, is it's like having a programmatic todo list. You know
838 how much work is left to be done, you're aware of what bugs there are,
839 and you'll know immediately when they're fixed.
841 Once a todo test starts succeeding, simply move it outside the block.
842 When the block is empty, delete it.
848 todo_skip $why, $how_many if $condition;
850 ...normal testing code...
853 With todo tests, it's best to have the tests actually run. That way
854 you'll know when they start passing. Sometimes this isn't possible.
855 Often a failing test will cause the whole program to die or hang, even
856 inside an C<eval BLOCK> with and using C<alarm>. In these extreme
857 cases you have no choice but to skip over the broken tests entirely.
859 The syntax and behavior is similar to a C<SKIP: BLOCK> except the
860 tests will be marked as failing but todo. Test::Harness will
861 interpret them as passing.
866 my($why, $how_many) = @_;
868 unless( defined $how_many ) {
869 # $how_many can only be avoided when no_plan is in use.
870 _carp "todo_skip() needs to know \$how_many tests are in the block"
871 unless $Test::Builder::No_Plan;
875 for( 1..$how_many ) {
876 $Test->todo_skip($why);
886 =head2 Comparison functions
888 Not everything is a simple eq check or regex. There are times you
889 need to see if two arrays are equivalent, for instance. For these
890 instances, Test::More provides a handful of useful functions.
892 B<NOTE> These are NOT well-tested on circular references. Nor am I
893 quite sure what will happen with filehandles.
899 is_deeply( $this, $that, $test_name );
901 Similar to is(), except that if $this and $that are hash or array
902 references, it does a deep comparison walking each data structure to
903 see if they are equivalent. If the two structures are different, it
904 will display the place where they start differing.
906 Barrie Slaymaker's Test::Differences module provides more in-depth
907 functionality along these lines, and it plays well with Test::More.
909 B<NOTE> Display of scalar refs is not quite 100%
913 use vars qw(@Data_Stack);
914 my $DNE = bless [], 'Does::Not::Exist';
916 my($this, $that, $name) = @_;
919 if( !ref $this || !ref $that ) {
920 $ok = $Test->is_eq($this, $that, $name);
923 local @Data_Stack = ();
924 if( _deep_check($this, $that) ) {
925 $ok = $Test->ok(1, $name);
928 $ok = $Test->ok(0, $name);
929 $ok = $Test->diag(_format_stack(@Data_Stack));
941 foreach my $entry (@Stack) {
942 my $type = $entry->{type} || '';
943 my $idx = $entry->{'idx'};
944 if( $type eq 'HASH' ) {
945 $var .= "->" unless $did_arrow++;
948 elsif( $type eq 'ARRAY' ) {
949 $var .= "->" unless $did_arrow++;
952 elsif( $type eq 'REF' ) {
957 my @vals = @{$Stack[-1]{vals}}[0,1];
959 ($vars[0] = $var) =~ s/\$FOO/ \$got/;
960 ($vars[1] = $var) =~ s/\$FOO/\$expected/;
962 my $out = "Structures begin differing at:\n";
963 foreach my $idx (0..$#vals) {
964 my $val = $vals[$idx];
965 $vals[$idx] = !defined $val ? 'undef' :
966 $val eq $DNE ? "Does not exist"
970 $out .= "$vars[0] = $vals[0]\n";
971 $out .= "$vars[1] = $vals[1]\n";
980 eq_array(\@this, \@that);
982 Checks if two arrays are equivalent. This is a deep check, so
983 multi-level structures are handled correctly.
990 return 1 if $a1 eq $a2;
993 my $max = $#$a1 > $#$a2 ? $#$a1 : $#$a2;
995 my $e1 = $_ > $#$a1 ? $DNE : $a1->[$_];
996 my $e2 = $_ > $#$a2 ? $DNE : $a2->[$_];
998 push @Data_Stack, { type => 'ARRAY', idx => $_, vals => [$e1, $e2] };
999 $ok = _deep_check($e1,$e2);
1000 pop @Data_Stack if $ok;
1013 # Quiet uninitialized value warnings when comparing undefs.
1020 if( UNIVERSAL::isa($e1, 'ARRAY') and
1021 UNIVERSAL::isa($e2, 'ARRAY') )
1023 $ok = eq_array($e1, $e2);
1025 elsif( UNIVERSAL::isa($e1, 'HASH') and
1026 UNIVERSAL::isa($e2, 'HASH') )
1028 $ok = eq_hash($e1, $e2);
1030 elsif( UNIVERSAL::isa($e1, 'REF') and
1031 UNIVERSAL::isa($e2, 'REF') )
1033 push @Data_Stack, { type => 'REF', vals => [$e1, $e2] };
1034 $ok = _deep_check($$e1, $$e2);
1035 pop @Data_Stack if $ok;
1037 elsif( UNIVERSAL::isa($e1, 'SCALAR') and
1038 UNIVERSAL::isa($e2, 'SCALAR') )
1040 push @Data_Stack, { type => 'REF', vals => [$e1, $e2] };
1041 $ok = _deep_check($$e1, $$e2);
1044 push @Data_Stack, { vals => [$e1, $e2] };
1056 eq_hash(\%this, \%that);
1058 Determines if the two hashes contain the same keys and values. This
1065 return 1 if $a1 eq $a2;
1068 my $bigger = keys %$a1 > keys %$a2 ? $a1 : $a2;
1069 foreach my $k (keys %$bigger) {
1070 my $e1 = exists $a1->{$k} ? $a1->{$k} : $DNE;
1071 my $e2 = exists $a2->{$k} ? $a2->{$k} : $DNE;
1073 push @Data_Stack, { type => 'HASH', idx => $k, vals => [$e1, $e2] };
1074 $ok = _deep_check($e1, $e2);
1075 pop @Data_Stack if $ok;
1085 eq_set(\@this, \@that);
1087 Similar to eq_array(), except the order of the elements is B<not>
1088 important. This is a deep check, but the irrelevancy of order only
1089 applies to the top level.
1093 # We must make sure that references are treated neutrally. It really
1094 # doesn't matter how we sort them, as long as both arrays are sorted
1095 # with the same algorithm.
1096 sub _bogus_sort { local $^W = 0; ref $a ? 0 : $a cmp $b }
1100 return 0 unless @$a1 == @$a2;
1102 # There's faster ways to do this, but this is easiest.
1103 return eq_array( [sort _bogus_sort @$a1], [sort _bogus_sort @$a2] );
1109 =head2 Extending and Embedding Test::More
1111 Sometimes the Test::More interface isn't quite enough. Fortunately,
1112 Test::More is built on top of Test::Builder which provides a single,
1113 unified backend for any test library to use. This means two test
1114 libraries which both use Test::Builder B<can be used together in the
1117 If you simply want to do a little tweaking of how the tests behave,
1118 you can access the underlying Test::Builder object like so:
1124 my $test_builder = Test::More->builder;
1126 Returns the Test::Builder object underlying Test::More for you to play
1132 return Test::Builder->new;
1140 Test::More is B<explicitly> tested all the way back to perl 5.004.
1142 =head1 BUGS and CAVEATS
1146 =item Making your own ok()
1148 If you are trying to extend Test::More, don't. Use Test::Builder
1151 =item The eq_* family has some caveats.
1153 =item Test::Harness upgrades
1155 no_plan and todo depend on new Test::Harness features and fixes. If
1156 you're going to distribute tests that use no_plan or todo your
1157 end-users will have to upgrade Test::Harness to the latest one on
1158 CPAN. If you avoid no_plan and TODO tests, the stock Test::Harness
1161 If you simply depend on Test::More, it's own dependencies will cause a
1162 Test::Harness upgrade.
1169 This is a case of convergent evolution with Joshua Pritikin's Test
1170 module. I was largely unaware of its existence when I'd first
1171 written my own ok() routines. This module exists because I can't
1172 figure out how to easily wedge test names into Test's interface (along
1173 with a few other problems).
1175 The goal here is to have a testing utility that's simple to learn,
1176 quick to use and difficult to trip yourself up with while still
1177 providing more flexibility than the existing Test.pm. As such, the
1178 names of the most common routines are kept tiny, special cases and
1179 magic side-effects are kept to a minimum. WYSIWYG.
1184 L<Test::Simple> if all this confuses you and you just want to write
1185 some tests. You can upgrade to Test::More later (it's forward
1188 L<Test::Differences> for more ways to test complex data structures.
1189 And it plays well with Test::More.
1191 L<Test> is the old testing module. Its main benefit is that it has
1192 been distributed with Perl since 5.004_05.
1194 L<Test::Harness> for details on how your test results are interpreted
1197 L<Test::Unit> describes a very featureful unit testing interface.
1199 L<Test::Inline> shows the idea of embedded testing.
1201 L<SelfTest> is another approach to embedded testing.
1206 Michael G Schwern E<lt>schwern@pobox.comE<gt> with much inspiration
1207 from Joshua Pritikin's Test module and lots of help from Barrie
1208 Slaymaker, Tony Bowden, chromatic and the perl-qa gang.
1213 Copyright 2001 by Michael G Schwern E<lt>schwern@pobox.comE<gt>.
1215 This program is free software; you can redistribute it and/or
1216 modify it under the same terms as Perl itself.
1218 See F<http://www.perl.com/perl/misc/Artistic.html>