Adding isnt() and next_test()
authorMichael G. Schwern <schwern@pobox.com>
Tue, 6 Nov 2001 20:58:45 +0000 (15:58 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 7 Nov 2001 01:06:41 +0000 (01:06 +0000)
Message-ID: <20011106205845.G29411@blackrider>

p4raw-id: //depot/perl@12878

t/test.pl

index 46d0656..6caa865 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -71,6 +71,17 @@ sub is {
     _ok($pass, _where(), @mess);
 }
 
+sub isnt {
+    my ($got, $isnt, $name, @mess) = @_;
+    my $pass = $got ne $isnt;
+    unless( $pass ) {
+        unshift(@mess, "# It should not be " .
+                      ( defined $got ? $got : "undef" ) . "\n",
+                       "# but it is.\n");
+    }
+    _ok($pass, _where(), $name, @mess);
+}
+
 # Note: this isn't quite as fancy as Test::More::like().
 sub like {
     my ($got, $expected, @mess) = @_;
@@ -100,6 +111,10 @@ sub fail {
     _ok(0, _where(), @_);
 }
 
+sub next_test {
+    $test++
+}
+
 # Note: can't pass multipart messages since we try to
 # be compatible with Test::More::skip().
 sub skip {