summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2001-11-02 10:36:41 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-02 20:07:05 +0000
commit1577bb166a95354d8198faf9da46ef504c9ebfd7 (patch)
tree0145045229195ae8c65943e6557643ff9aa9f26a /t
parent8f4f83badb7d1ba9fbdc45673bc7277e7619b775 (diff)
downloadperl-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.pl19
1 files changed, 6 insertions, 13 deletions
diff --git a/t/test.pl b/t/test.pl
index 029d80f5b7..46d0656142 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -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;