#!/usr/bin/perl -w # # An example of Perl's testing protocol # use Test::Simple tests => 2; # Declare number of tests we'll do, # in case we crash part way through. # The general format of a test is : # ok( $assertion, "comment" ); # Does sqrt.pl compile? my $compiles = eval {require 'sqrt.pl'}; ok( $compiles , " compiles "); exit unless $compiles; # don't bother with other tests. # Does SQRT() find the root of 4 correctly? ok( SQRT(4) == 2, " SQRT(4) is 2 ");