diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-10-02 15:57:26 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-10-02 15:57:26 +0100 |
commit | b8a2040150d386de90994afd87f9d01bd861104a (patch) | |
tree | 9418ac04b77045e3bb187954c5fbf873557f7474 /cpan/Test-Harness/t/sample-tests | |
parent | 8d4ff56f76907d1619ddc5fd7040d3823057ec47 (diff) | |
download | perl-b8a2040150d386de90994afd87f9d01bd861104a.tar.gz |
Move Test::Harness from ext/ to cpan/
Diffstat (limited to 'cpan/Test-Harness/t/sample-tests')
55 files changed, 488 insertions, 0 deletions
diff --git a/cpan/Test-Harness/t/sample-tests/bailout b/cpan/Test-Harness/t/sample-tests/bailout new file mode 100644 index 0000000000..b25f417b52 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/bailout @@ -0,0 +1,11 @@ +# Sleep makes Mac OS open3 race problem more repeatable +sleep 1; +print <<DUMMY_TEST; +1..5 +ok 1 +ok 2 +ok 3 +Bail out! GERONIMMMOOOOOO!!! +ok 4 +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/bignum b/cpan/Test-Harness/t/sample-tests/bignum new file mode 100644 index 0000000000..b5824a12a1 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/bignum @@ -0,0 +1,7 @@ +print <<DUMMY; +1..2 +ok 1 +ok 2 +ok 136211425 +ok 136211426 +DUMMY diff --git a/cpan/Test-Harness/t/sample-tests/bignum_many b/cpan/Test-Harness/t/sample-tests/bignum_many new file mode 100644 index 0000000000..1e30b2f1dd --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/bignum_many @@ -0,0 +1,14 @@ +print <<DUMMY; +1..2 +ok 1 +ok 2 +ok 99997 +ok 99998 +ok 99999 +ok 100000 +ok 100001 +ok 100002 +ok 100003 +ok 100004 +ok 100005 +DUMMY diff --git a/cpan/Test-Harness/t/sample-tests/combined b/cpan/Test-Harness/t/sample-tests/combined new file mode 100644 index 0000000000..7e157092b3 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/combined @@ -0,0 +1,13 @@ +print <<DUMMY_TEST; +1..10 +ok 1 +ok 2 basset hounds got long ears +not ok 3 all hell broke loose +not ok 4 # TODO if I heard a voice from heaven ... +ok say "live without loving", +ok 6 I'd beg off. +ok 7 # Skip contract negotiations +ok 8 Girls are such exquisite hell +ok 9 Elegy 9B # TOdO +not ok 10 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/combined_compat b/cpan/Test-Harness/t/sample-tests/combined_compat new file mode 100644 index 0000000000..8dfaa28e92 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/combined_compat @@ -0,0 +1,13 @@ +print <<DUMMY_TEST; +1..10 todo 4 10 +ok 1 +ok 2 basset hounds got long ears +not ok 3 all hell broke lose +ok 4 +ok +ok 6 +ok 7 # Skip contract negociations +ok 8 +not ok 9 +not ok 10 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/delayed b/cpan/Test-Harness/t/sample-tests/delayed new file mode 100644 index 0000000000..1f24ef6790 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/delayed @@ -0,0 +1,26 @@ +# Used to test Process.pm +use Time::HiRes qw(sleep); + +my $delay = 0.01; + +$| = 1; + +my @parts = ( + "1.", + ".5\n", + "ok 1 00000\n", + "ok 2\nnot", + " ok 3", + "\nok 4\nok ", + "5 00000", + "" +); + +my $delay_at = shift || 0; + +while (@parts) { + sleep $delay if ( $delay_at & 1 ); + $delay_at >>= 1; + print shift @parts; +} +sleep $delay if ( $delay_at & 1 ); diff --git a/cpan/Test-Harness/t/sample-tests/descriptive b/cpan/Test-Harness/t/sample-tests/descriptive new file mode 100644 index 0000000000..e165ac1bf5 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/descriptive @@ -0,0 +1,8 @@ +print <<DUMMY_TEST; +1..5 +ok 1 Interlock activated +ok 2 Megathrusters are go +ok 3 Head formed +ok 4 Blazing sword formed +ok 5 Robeast destroyed +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/descriptive_trailing b/cpan/Test-Harness/t/sample-tests/descriptive_trailing new file mode 100644 index 0000000000..f92d7ca694 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/descriptive_trailing @@ -0,0 +1,8 @@ +print <<DUMMY_TEST; +ok 1 Interlock activated +ok 2 Megathrusters are go +ok 3 Head formed +ok 4 Blazing sword formed +ok 5 Robeast destroyed +1..5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/die b/cpan/Test-Harness/t/sample-tests/die new file mode 100644 index 0000000000..ca8b0a9b0b --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/die @@ -0,0 +1,2 @@ +eval "use vmsish 'hushed'" if ($^O eq 'VMS'); +exit 1; # exit because die() can be noisy diff --git a/cpan/Test-Harness/t/sample-tests/die_head_end b/cpan/Test-Harness/t/sample-tests/die_head_end new file mode 100644 index 0000000000..494e4d3c82 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/die_head_end @@ -0,0 +1,9 @@ +print <<DUMMY_TEST; +ok 1 +ok 2 +ok 3 +ok 4 +DUMMY_TEST + +eval "use vmsish 'hushed'" if ($^O eq 'VMS'); +exit 1; diff --git a/cpan/Test-Harness/t/sample-tests/die_last_minute b/cpan/Test-Harness/t/sample-tests/die_last_minute new file mode 100644 index 0000000000..ea533d628e --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/die_last_minute @@ -0,0 +1,10 @@ +print <<DUMMY_TEST; +ok 1 +ok 2 +ok 3 +ok 4 +1..4 +DUMMY_TEST + +eval "use vmsish 'hushed'" if ($^O eq 'VMS'); +exit 1; diff --git a/cpan/Test-Harness/t/sample-tests/die_unfinished b/cpan/Test-Harness/t/sample-tests/die_unfinished new file mode 100644 index 0000000000..3efd08ff09 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/die_unfinished @@ -0,0 +1,9 @@ +print <<DUMMY_TEST; +1..4 +ok 1 +ok 2 +ok 3 +DUMMY_TEST + +eval "use vmsish 'hushed'" if ($^O eq 'VMS'); +exit 1; diff --git a/cpan/Test-Harness/t/sample-tests/duplicates b/cpan/Test-Harness/t/sample-tests/duplicates new file mode 100644 index 0000000000..63f6a706b6 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/duplicates @@ -0,0 +1,14 @@ +print <<DUMMY_TEST +1..10 +ok 1 +ok 2 +ok 3 +ok 4 +ok 4 +ok 5 +ok 6 +ok 7 +ok 8 +ok 9 +ok 10 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/echo b/cpan/Test-Harness/t/sample-tests/echo new file mode 100644 index 0000000000..6696e71f17 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/echo @@ -0,0 +1,2 @@ +print '1..', scalar(@ARGV), "\n"; +print "ok $_ ", $ARGV[ $_ - 1 ], "\n" for 1 .. @ARGV; diff --git a/cpan/Test-Harness/t/sample-tests/empty b/cpan/Test-Harness/t/sample-tests/empty new file mode 100644 index 0000000000..66d42ad402 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/empty @@ -0,0 +1,2 @@ +__END__ +Used to exercise the "empty test" case. diff --git a/cpan/Test-Harness/t/sample-tests/escape_eol b/cpan/Test-Harness/t/sample-tests/escape_eol new file mode 100644 index 0000000000..1b8ba27f1e --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/escape_eol @@ -0,0 +1,5 @@ +print <<DUMMY_TEST; +1..2 +ok 1 Should parse as literal backslash --> \\ +ok 2 Not a continuation line +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/escape_hash b/cpan/Test-Harness/t/sample-tests/escape_hash new file mode 100644 index 0000000000..c404372c0c --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/escape_hash @@ -0,0 +1,6 @@ +print <<DUMMY_TEST; +1..3 +ok 1 Not a \\# TODO +ok 2 Not a \\# SKIP +ok 3 Escaped \\\\\\# +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/head_end b/cpan/Test-Harness/t/sample-tests/head_end new file mode 100644 index 0000000000..14a32f2fe6 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/head_end @@ -0,0 +1,11 @@ +print <<DUMMY_TEST; +# comments +ok 1 +ok 2 +ok 3 +ok 4 +# comment +1..4 +# more ignored stuff +# and yet more +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/head_fail b/cpan/Test-Harness/t/sample-tests/head_fail new file mode 100644 index 0000000000..9d1667ab19 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/head_fail @@ -0,0 +1,11 @@ +print <<DUMMY_TEST; +# comments +ok 1 +not ok 2 +ok 3 +ok 4 +# comment +1..4 +# more ignored stuff +# and yet more +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/inc_taint b/cpan/Test-Harness/t/sample-tests/inc_taint new file mode 100644 index 0000000000..d1be66706c --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/inc_taint @@ -0,0 +1,6 @@ +#!/usr/bin/perl -Tw + +use Test::More tests => 1; + +ok( grep( /examples/, @INC ) ); + diff --git a/cpan/Test-Harness/t/sample-tests/junk_before_plan b/cpan/Test-Harness/t/sample-tests/junk_before_plan new file mode 100644 index 0000000000..b2ad018301 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/junk_before_plan @@ -0,0 +1,6 @@ +print <<DUMMY_TEST; +this is junk +# this is a comment +1..1 +ok 1 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/lone_not_bug b/cpan/Test-Harness/t/sample-tests/lone_not_bug new file mode 100644 index 0000000000..10eaa2a3b0 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/lone_not_bug @@ -0,0 +1,9 @@ +# There was a bug where the first test would be considered a +# 'lone not' failure. +print <<DUMMY; +ok 1 +ok 2 +ok 3 +ok 4 +1..4 +DUMMY diff --git a/cpan/Test-Harness/t/sample-tests/no_nums b/cpan/Test-Harness/t/sample-tests/no_nums new file mode 100644 index 0000000000..c32d3f22ba --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/no_nums @@ -0,0 +1,8 @@ +print <<DUMMY_TEST; +1..5 +ok +ok +not ok +ok +ok +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/no_output b/cpan/Test-Harness/t/sample-tests/no_output new file mode 100644 index 0000000000..505acda7e6 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/no_output @@ -0,0 +1,3 @@ +#!/usr/bin/perl -w + +exit; diff --git a/cpan/Test-Harness/t/sample-tests/out_err_mix b/cpan/Test-Harness/t/sample-tests/out_err_mix new file mode 100644 index 0000000000..c802eb4a11 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/out_err_mix @@ -0,0 +1,13 @@ +sub _autoflush { + my $flushed = shift; + my $old_fh = select $flushed; + $| = 1; + select $old_fh; +} + +_autoflush( \*STDOUT ); +_autoflush( \*STDERR ); + +print STDOUT "one\n"; +print STDERR "two\n\n"; +print STDOUT "three\n"; diff --git a/cpan/Test-Harness/t/sample-tests/out_of_order b/cpan/Test-Harness/t/sample-tests/out_of_order new file mode 100644 index 0000000000..77641aa362 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/out_of_order @@ -0,0 +1,22 @@ +# From a bungled core thread test. +# +# The important thing here is that the last test is the right test. +# Test::Harness would misparse this as being a valid test. +print <<DUMMY; +ok 2 - Test that argument passing works +ok 3 - Test that passing arguments as references work +ok 4 - Test a normal sub +ok 6 - Detach test +ok 8 - Nested thread test +ok 9 - Nested thread test +ok 10 - Wanted 7, got 7 +ok 11 - Wanted 7, got 7 +ok 12 - Wanted 8, got 8 +ok 13 - Wanted 8, got 8 +1..15 +ok 1 +ok 5 - Check that Config::threads is true +ok 7 - Detach test +ok 14 - Check so that tid for threads work for main thread +ok 15 - Check so that tid for threads work for main thread +DUMMY diff --git a/cpan/Test-Harness/t/sample-tests/schwern b/cpan/Test-Harness/t/sample-tests/schwern new file mode 100644 index 0000000000..d45726bc7a --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/schwern @@ -0,0 +1,3 @@ +use Test::More; +plan tests => 1; +ok 23, 42; diff --git a/cpan/Test-Harness/t/sample-tests/schwern-todo-quiet b/cpan/Test-Harness/t/sample-tests/schwern-todo-quiet new file mode 100644 index 0000000000..4d482d43fa --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/schwern-todo-quiet @@ -0,0 +1,13 @@ +print <<DUMMY_TEST; +1..3 +ok 1 +not ok 2 +# Failed test at ../../andy/schwern.pl line 17. +# got: '23' +# expected: '42' +not ok 3 # TODO Roman numerials still not a built in type +# Failed (TODO) test at ../../andy/schwern.pl line 20. +# got: 'XXIII' +# expected: '23' +# Looks like you failed 1 test of 3. +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/segfault b/cpan/Test-Harness/t/sample-tests/segfault new file mode 100644 index 0000000000..c5670a42b5 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/segfault @@ -0,0 +1,5 @@ +#!/usr/bin/perl + +print "1..1\n"; +print "ok 1\n"; +kill 11, $$; diff --git a/cpan/Test-Harness/t/sample-tests/sequence_misparse b/cpan/Test-Harness/t/sample-tests/sequence_misparse new file mode 100644 index 0000000000..c66d127bb0 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/sequence_misparse @@ -0,0 +1,14 @@ +# +# This was causing parse failures due to an error in the TAP specification. +# Hash marks *are* allowed in the description. +# +print <<DUMMY; +1..5 +ok 1 +ok 2 +ok 3 # skipped on foobar system +# 1234567890123456789012345678901234567890 +ok 4 +# 1234567890123456789012345678901234567890 +ok 5 +DUMMY diff --git a/cpan/Test-Harness/t/sample-tests/shbang_misparse b/cpan/Test-Harness/t/sample-tests/shbang_misparse new file mode 100644 index 0000000000..ab93b468ae --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/shbang_misparse @@ -0,0 +1,12 @@ +#!/usr/bin/perl-latest + +# The above #! line was misparsed as having a -t. +# Pre-5.8 this will simply cause perl to choke, since there was no -t. +# Post-5.8 taint warnings will mistakenly be on. + +print "1..2\n"; +print "ok 1\n"; +my $warning = ''; +$SIG{__WARN__} = sub { $warning .= $_[0] }; +eval( "#" . substr( $0, 0, 0 ) ); +print $warning ? "not ok 2\n" : "ok 2\n"; diff --git a/cpan/Test-Harness/t/sample-tests/simple b/cpan/Test-Harness/t/sample-tests/simple new file mode 100644 index 0000000000..d6b85846b2 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/simple @@ -0,0 +1,8 @@ +print <<DUMMY_TEST; +1..5 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/simple_fail b/cpan/Test-Harness/t/sample-tests/simple_fail new file mode 100644 index 0000000000..aa65f5f66d --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/simple_fail @@ -0,0 +1,8 @@ +print <<DUMMY_TEST; +1..5 +ok 1 +not ok 2 +ok 3 +ok 4 +not ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/simple_yaml b/cpan/Test-Harness/t/sample-tests/simple_yaml new file mode 100644 index 0000000000..9f52c5c8a8 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/simple_yaml @@ -0,0 +1,27 @@ +print <<DUMMY_TEST; +TAP version 13 +1..5 +ok 1 +ok 2 + --- + - + fnurk: skib + ponk: gleeb + - + bar: krup + foo: plink + ... +ok 3 +ok 4 + --- + expected: + - 1 + - 2 + - 4 + got: + - 1 + - pong + - 4 + ... +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/skip b/cpan/Test-Harness/t/sample-tests/skip new file mode 100644 index 0000000000..6a9cd662bc --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/skip @@ -0,0 +1,8 @@ +print <<DUMMY_TEST; +1..5 +ok 1 +ok 2 # skip rain delay +ok 3 +ok 4 +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/skip_nomsg b/cpan/Test-Harness/t/sample-tests/skip_nomsg new file mode 100644 index 0000000000..51d1ed6b43 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/skip_nomsg @@ -0,0 +1,4 @@ +print <<DUMMY; +1..1 +ok 1 # Skip +DUMMY diff --git a/cpan/Test-Harness/t/sample-tests/skipall b/cpan/Test-Harness/t/sample-tests/skipall new file mode 100644 index 0000000000..ceb2c19b3a --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/skipall @@ -0,0 +1,3 @@ +print <<DUMMY_TEST; +1..0 # skipping: rope +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/skipall_nomsg b/cpan/Test-Harness/t/sample-tests/skipall_nomsg new file mode 100644 index 0000000000..9b0dc11a69 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/skipall_nomsg @@ -0,0 +1,2 @@ +print "1..0\n"; +exit 0; diff --git a/cpan/Test-Harness/t/sample-tests/skipall_v13 b/cpan/Test-Harness/t/sample-tests/skipall_v13 new file mode 100644 index 0000000000..d16bd4f652 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/skipall_v13 @@ -0,0 +1,4 @@ +print <<DUMMY_TEST; +TAP version 13 +1..0 # skipping: rope +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/space_after_plan b/cpan/Test-Harness/t/sample-tests/space_after_plan new file mode 100644 index 0000000000..d454c20d4d --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/space_after_plan @@ -0,0 +1,3 @@ +# gforth TAP generates a space after the plan. Should probably be allowed. +print "1..5 \n"; +print "ok $_ \n" for 1..5; diff --git a/cpan/Test-Harness/t/sample-tests/stdout_stderr b/cpan/Test-Harness/t/sample-tests/stdout_stderr new file mode 100644 index 0000000000..ce17484d65 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/stdout_stderr @@ -0,0 +1,9 @@ +use Test::More 'no_plan'; +diag 'comments'; +ok 1; +ok 1; +ok 1; +diag 'comment'; +ok 1; +diag 'more ignored stuff'; +diag 'and yet more'; diff --git a/cpan/Test-Harness/t/sample-tests/strict b/cpan/Test-Harness/t/sample-tests/strict new file mode 100644 index 0000000000..b89138de40 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/strict @@ -0,0 +1,9 @@ +print <<DUMMY_TEST; +TAP version 13 +1..1 +pragma +strict +Nonsense! +pragma -strict +Doesn't matter. +ok 1 All OK +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/switches b/cpan/Test-Harness/t/sample-tests/switches new file mode 100644 index 0000000000..8ce9c9a589 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/switches @@ -0,0 +1,2 @@ +print "1..1\n"; +print $INC{'strict.pm'} ? "ok 1\n" : "not ok 1\n"; diff --git a/cpan/Test-Harness/t/sample-tests/taint b/cpan/Test-Harness/t/sample-tests/taint new file mode 100644 index 0000000000..c36698e042 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/taint @@ -0,0 +1,7 @@ +#!/usr/bin/perl -Tw + +use lib qw(t/lib); +use Test::More tests => 1; + +eval { `$^X -e1` }; +like( $@, '/^Insecure dependency/', '-T honored' ); diff --git a/cpan/Test-Harness/t/sample-tests/taint_warn b/cpan/Test-Harness/t/sample-tests/taint_warn new file mode 100644 index 0000000000..398d6181ee --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/taint_warn @@ -0,0 +1,11 @@ +#!/usr/bin/perl -tw + +use lib qw(t/lib); +use Test::More tests => 1; + +my $warnings = ''; +{ + local $SIG{__WARN__} = sub { $warnings .= join '', @_ }; + `$^X -e1`; +} +like( $warnings, '/^Insecure dependency/', '-t honored' ); diff --git a/cpan/Test-Harness/t/sample-tests/todo b/cpan/Test-Harness/t/sample-tests/todo new file mode 100644 index 0000000000..77f00b4dc9 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/todo @@ -0,0 +1,8 @@ +print <<DUMMY_TEST; +1..5 todo 3 2; +ok 1 +ok 2 +not ok 3 +ok 4 +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/todo_inline b/cpan/Test-Harness/t/sample-tests/todo_inline new file mode 100644 index 0000000000..5b96d68caf --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/todo_inline @@ -0,0 +1,6 @@ +print <<DUMMY_TEST; +1..3 +not ok 1 - Foo # TODO Just testing the todo interface. +ok 2 - Unexpected success # TODO Just testing the todo interface. +ok 3 - This is not todo +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/todo_misparse b/cpan/Test-Harness/t/sample-tests/todo_misparse new file mode 100644 index 0000000000..138f3fbaaa --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/todo_misparse @@ -0,0 +1,5 @@ +print <<'END'; +1..1 +not ok 1 Hamlette # TODOORNOTTODO +END + diff --git a/cpan/Test-Harness/t/sample-tests/too_many b/cpan/Test-Harness/t/sample-tests/too_many new file mode 100644 index 0000000000..46acaded4d --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/too_many @@ -0,0 +1,14 @@ +print <<DUMMY; +1..3 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 +DUMMY + +exit 4; # simulate Test::More's exit status + + diff --git a/cpan/Test-Harness/t/sample-tests/version_good b/cpan/Test-Harness/t/sample-tests/version_good new file mode 100644 index 0000000000..9e4ab908a2 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/version_good @@ -0,0 +1,9 @@ +print <<DUMMY_TEST; +TAP version 13 +1..5 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/version_late b/cpan/Test-Harness/t/sample-tests/version_late new file mode 100644 index 0000000000..4537a322e3 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/version_late @@ -0,0 +1,9 @@ +print <<DUMMY_TEST; +1..5 +TAP version 13 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/version_old b/cpan/Test-Harness/t/sample-tests/version_old new file mode 100644 index 0000000000..3c0c44ffb1 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/version_old @@ -0,0 +1,9 @@ +print <<DUMMY_TEST; +TAP version 12 +1..5 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/vms_nit b/cpan/Test-Harness/t/sample-tests/vms_nit new file mode 100644 index 0000000000..1df7804309 --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/vms_nit @@ -0,0 +1,6 @@ +print <<DUMMY; +1..2 +not +ok 1 +ok 2 +DUMMY diff --git a/cpan/Test-Harness/t/sample-tests/with_comments b/cpan/Test-Harness/t/sample-tests/with_comments new file mode 100644 index 0000000000..7aa913985b --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/with_comments @@ -0,0 +1,14 @@ +print <<DUMMY_TEST; +# and stuff +1..5 todo 1 2 4 5; +# yeah, that +not ok 1 +# Failed test 1 in t/todo.t at line 9 *TODO* +ok 2 # (t/todo.t at line 10 TODO?!) +ok 3 +not ok 4 +# Test 4 got: '0' (t/todo.t at line 12 *TODO*) +# Expected: '1' (need more tuits) +ok 5 # (t/todo.t at line 13 TODO?!) +# woo +DUMMY_TEST diff --git a/cpan/Test-Harness/t/sample-tests/zero_valid b/cpan/Test-Harness/t/sample-tests/zero_valid new file mode 100644 index 0000000000..dae91a18fb --- /dev/null +++ b/cpan/Test-Harness/t/sample-tests/zero_valid @@ -0,0 +1,8 @@ +print <<DUMMY; +1..5 +ok 1 - One +ok 2 - Two +ok - Three +ok 0 - Four +ok 5 - Five +DUMMY |