From fdec8735b5a913c856025793c0239d908ad4bc2e Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Mon, 12 Oct 2009 00:30:06 +0100 Subject: [PATCH] Implement TODO support locally in t/comp/opsubs.t Removes the FAILED for test 22 on Win32. --- t/comp/opsubs.t | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/t/comp/opsubs.t b/t/comp/opsubs.t index bfb6c3f..89b1af5 100644 --- a/t/comp/opsubs.t +++ b/t/comp/opsubs.t @@ -12,7 +12,12 @@ my $test = 0; sub failed { my ($got, $expected, $name) = @_; - print "not ok $test - $name\n"; + if ($::TODO) { + print "not ok $test - $name # TODO: $::TODO\n"; + } + else { + print "not ok $test - $name\n"; + } my @caller = caller(1); print "# Failed test at $caller[1] line $caller[2]\n"; if (defined $got) { @@ -28,7 +33,12 @@ sub like { my ($got, $pattern, $name) = @_; $test = $test + 1; if (defined $got && $got =~ $pattern) { - print "ok $test - $name\n"; + if ($::TODO) { + print "ok $test - $name # TODO: $::TODO\n"; + } + else { + print "ok $test - $name\n"; + } # Principle of least surprise - maintain the expected interface, even # though we aren't using it here (yet). return 1; @@ -40,7 +50,12 @@ sub is { my ($got, $expect, $name) = @_; $test = $test + 1; if (defined $got && $got eq $expect) { - print "ok $test - $name\n"; + if ($::TODO) { + print "ok $test - $name # TODO: $::TODO\n"; + } + else { + print "ok $test - $name\n"; + } return 1; } failed($got, "'$expect'", $name); @@ -50,7 +65,12 @@ sub isnt { my ($got, $expect, $name) = @_; $test = $test + 1; if (defined $got && $got ne $expect) { - print "ok $test - $name\n"; + if ($::TODO) { + print "ok $test - $name # TODO: $::TODO\n"; + } + else { + print "ok $test - $name\n"; + } return 1; } failed($got, "not '$expect'", $name); @@ -60,7 +80,12 @@ sub can_ok { my ($class, $method) = @_; $test = $test + 1; if (eval { $class->can($method) }) { - print "ok $test - $class->can('$method')\n"; + if ($::TODO) { + print "ok $test - $class->can('$method') # TODO: $::TODO\n"; + } + else { + print "ok $test - $class->can('$method')\n"; + } return 1; } my @caller = caller; -- 1.8.3.1