Skip to content

Commit

Permalink
Refactor basic math tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Sep 17, 2009
1 parent 131c7f2 commit 21b18c7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions t/01-basic-math.t
@@ -1,20 +1,19 @@
print "1..3\n";
my $t=1;

{
my $x = 5;
print "not " unless ($x == 5);
ok(1,"x=$x");
ok($x==5,"x=$x");
$x++;
print "not " unless ($x == 6);
ok(2,"x=$x");
ok($x==6,"x=$x");
$x--;
print "not " unless ($x == 5);
ok(3, "x=$x");
ok($x==5, "x=$x");
}

sub ok {
my ($num,$diag) = @_;
print "ok $num";
my ($truth,$diag) = @_;
print $truth ? "ok $t" : "not ok $t";
$t++;

print $diag ? " # $diag\n" : "\n";
}

0 comments on commit 21b18c7

Please sign in to comment.