background image
<< Something Completely Different | Perl's Testing Protocol >>
<< Something Completely Different | Perl's Testing Protocol >>
The Most Basic Perl Test Program
The Most Basic Perl Test Program
#!/usr/bin/perl -w
print "1..1\n";
print 1 + 1 == 2 ? "ok 1\n" : "not ok 1\n";
Since 1 + 1 is 2, this prints:
1..1
ok 1
x
"1..1" I'm going to run one test.
x
"ok 1" The first test passed.