to.pm.org Jan 2005 Testing the Testers #9

Feeping Creaturism

use strict;
use Test::More tests => 4;
use Test::Builder;
use Test::Foo;
is( foo_ok('foo'), 1, 'foo_ok returns 1');
isnt( foo_ok('bar'), 1, 'foo_ok does not returns 1');

my $t = Test::Builder->new;
$t->no_ending(1);

1..4
ok 1 - test if 'foo' eq 'foo'
ok 2 - foo_ok returns 1
not ok 3 - test if 'bar' eq 'foo'
#     Failed test (test_foo.t at line 6)
# 'bar' does not equal 'foo'
ok 4 - foo_ok does not returns 1

But we're still not testing the output of the failure!

< | ^ | >
Copyright © 2005 James FitzGibbon