in reply to RFC: Runnable test code integrated into Modules.
Other already available options is Test::Inline (formerly Pod::Tests) by our favorite b*#@! Schwern ;)package Buttersquash; sub foo { 'bar' } sub bar { 'foo' } package main; unless(caller()){ print "1..3\n"; print "ok 1\n"; print "not " if Buttersquash->foo ne 'bar'; print "ok 2\n"; print "not " if Buttersquash->bar ne 'foo'; print "ok 3\n"; } =head1 SELF CONTAINED TEST If you already installed this, simply run this oneliner # on nix perl -MButtersquash -e' exec $^X, $INC{q[Buttersquash.pm]}' # on windows perl -MButtersquash -e" exec $^X, $INC{q[Buttersquash.pm]}" or simply perl Buttersquash.pm =cut
|
MJD says you can't just make shit up and expect the computer to know what you mean, retardo! ** The Third rule of perl club is a statement of fact: pod is sexy. |
|
|---|