From d581aa025b17a0a9dcb488ebc69c579d2a83db42 Mon Sep 17 00:00:00 2001 From: "Michael G. Schwern" Date: Wed, 9 Nov 2011 16:59:07 -0800 Subject: [PATCH] Move the test for ok(1, "") into the TAP formatter tests. For #84 --- t/Builder/output.t | 6 ++---- t/Formatter/TAP/basic.t | 11 +++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/t/Builder/output.t b/t/Builder/output.t index 10abb8f3d..8ef0ac9a7 100644 --- a/t/Builder/output.t +++ b/t/Builder/output.t @@ -77,24 +77,22 @@ END { 1 while unlink($tmpfile) } my $out = $tb->output(\$fakeout); $tb->exported_to(__PACKAGE__); $tb->no_ending(1); - $tb->plan(tests => 6); + $tb->plan(tests => 5); $tb->ok(1, "ok"); $tb->ok(1, "ok\n"); $tb->ok(1, "ok, like\nok"); $tb->skip("wibble\nmoof"); $tb->todo_skip("todo\nskip\n"); - $tb->ok(1, ""); is( $fakeout, <<'OUTPUT' ); TAP version 13 -1..6 +1..5 ok 1 - ok ok 2 - ok\n ok 3 - ok, like\nok ok 4 # SKIP wibble\nmoof not ok 5 # TODO SKIP todo\nskip\n -ok 6 - OUTPUT } diff --git a/t/Formatter/TAP/basic.t b/t/Formatter/TAP/basic.t index a1a3b2457..9fb2e5a30 100644 --- a/t/Formatter/TAP/basic.t +++ b/t/Formatter/TAP/basic.t @@ -301,4 +301,15 @@ OUT } +note "Name with an empty string (github #84)"; { + my $result = Test::Builder2::Result->new_result( + pass => 1, + test_number => 99, + name => '' + ); + + $ec->post_event($result); + is(last_output, "ok 99 - \n", "empty string name preserved"); +} + done_testing();