diff options
author | Michael G. Schwern <schwern@pobox.com> | 2001-11-02 10:36:41 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-02 20:07:05 +0000 |
commit | 1577bb166a95354d8198faf9da46ef504c9ebfd7 (patch) | |
tree | 0145045229195ae8c65943e6557643ff9aa9f26a /t | |
parent | 8f4f83badb7d1ba9fbdc45673bc7277e7619b775 (diff) | |
download | perl-1577bb166a95354d8198faf9da46ef504c9ebfd7.tar.gz |
_expect and other little tweaks
Message-ID: <20011102153641.E23234@blackrider>
p4raw-id: //depot/perl@12817
Diffstat (limited to 't')
-rw-r--r-- | t/test.pl | 19 |
1 files changed, 6 insertions, 13 deletions
@@ -46,6 +46,8 @@ sub _ok { print "# Failed $where\n"; } $test++; + + return $pass; } sub _where { @@ -58,15 +60,6 @@ sub ok { _ok($pass, _where(), @mess); } -sub _expect { - my ($got, $pass, @mess) = @_; - if ($pass) { - ok(1, @mess); - } else { - ok(0, @mess); - } -} - sub is { my ($got, $expected, @mess) = @_; my $pass = $got eq $expected; @@ -75,7 +68,7 @@ sub is { "# got '$got'\n", "# expected '$expected'\n"); } - _expect($pass, _where(), @mess); + _ok($pass, _where(), @mess); } # Note: this isn't quite as fancy as Test::More::like(). @@ -96,7 +89,7 @@ sub like { "# expected /$expected/\n"); } } - _expect($pass, _where(), @mess); + _ok($pass, _where(), @mess); } sub pass { @@ -133,7 +126,7 @@ sub require_ok { eval <<REQUIRE_OK; require $require; REQUIRE_OK - ok(!$@, "require $require"); + _ok(!$@, _where(), "require $require"); } sub use_ok { @@ -141,7 +134,7 @@ sub use_ok { eval <<USE_OK; use $use; USE_OK - ok(!$@, "use $use"); + _ok(!$@, _where(), "use $use"); } 1; |