--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+plan skip_all => 'perl 5.8 required to test pass()' unless $] >= 5.008;
+
+my $buf = '';
+open my $memory_stream, '>', \$buf
+ or plan skip_all => 'could not create the in-memory file';
+
+plan tests => 5;
+
+require Test::Leaner;
+
+{
+ local $@;
+ eval { Test::Leaner::tap_stream($memory_stream) };
+ is $@, '', 'tap_stream($fh) does not croak';
+}
+
+{
+ local $@;
+ $buf = '';
+ seek $memory_stream, 0, 0;
+ eval { Test::Leaner::pass() };
+ is $@, '', 'pass() does not croak';
+ is $buf, "ok 1\n", 'pass() produces the correct TAP code';
+}
+
+{
+ local $@;
+ $buf = '';
+ seek $memory_stream, 0, 0;
+ eval { Test::Leaner::pass('this is a comment') };
+ is $@, '', 'pass("comment") does not croak';
+ is $buf, "ok 2 - this is a comment\n",
+ 'pass("comment") produces the correct TAP code';
+}
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+plan skip_all => 'perl 5.8 required to test fail()' unless $] >= 5.008;
+
+my $buf = '';
+open my $memory_stream, '>', \$buf
+ or plan skip_all => 'could not create the in-memory file';
+
+plan tests => 5;
+
+require Test::Leaner;
+
+{
+ local $@;
+ eval { Test::Leaner::tap_stream($memory_stream) };
+ is $@, '', 'tap_stream($fh) does not croak';
+}
+
+{
+ local $@;
+ $buf = '';
+ seek $memory_stream, 0, 0;
+ eval { Test::Leaner::fail() };
+ is $@, '', 'fail() does not croak';
+ is $buf, "not ok 1\n", 'fail() produces the correct TAP code';
+}
+
+{
+ local $@;
+ $buf = '';
+ seek $memory_stream, 0, 0;
+ eval { Test::Leaner::fail('this is a comment') };
+ is $@, '', 'fail("comment") does not croak';
+ is $buf, "not ok 2 - this is a comment\n",
+ 'fail("comment") produces the correct TAP code';
+}