dslinux/user/perl/t/lib/sample-tests bailout bignum bignum_many combined descriptive die die_head_end die_last_minute duplicates head_end head_fail inc_taint lone_not_bug no_nums no_output out_of_order segfault shbang_misparse simple simple_fail skip skip_nomsg skipall skipall_nomsg switches taint taint_warn todo todo_inline too_many vms_nit with_comments

cayenne dslinux_cayenne at user.in-berlin.de
Mon Dec 4 18:01:59 CET 2006


Update of /cvsroot/dslinux/dslinux/user/perl/t/lib/sample-tests
In directory antilope:/tmp/cvs-serv17422/t/lib/sample-tests

Added Files:
	bailout bignum bignum_many combined descriptive die 
	die_head_end die_last_minute duplicates head_end head_fail 
	inc_taint lone_not_bug no_nums no_output out_of_order segfault 
	shbang_misparse simple simple_fail skip skip_nomsg skipall 
	skipall_nomsg switches taint taint_warn todo todo_inline 
	too_many vms_nit with_comments 
Log Message:
Adding fresh perl source to HEAD to branch from

--- NEW FILE: simple_fail ---
print <<DUMMY_TEST;
1..5
ok 1
not ok 2
ok 3
ok 4
not ok 5
DUMMY_TEST

--- NEW FILE: bignum ---
print <<DUMMY;
1..2
ok 1
ok 2
ok 136211425
ok 136211426
DUMMY

--- NEW FILE: no_output ---
#!/usr/bin/perl -w

exit;

--- NEW FILE: simple ---
print <<DUMMY_TEST;
1..5
ok 1
ok 2
ok 3
ok 4
ok 5
DUMMY_TEST

--- NEW FILE: skip ---
print <<DUMMY_TEST;
1..5
ok 1
ok 2    # skip rain delay
ok 3
ok 4
ok 5
DUMMY_TEST

--- NEW FILE: too_many ---
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



--- NEW FILE: vms_nit ---
print <<DUMMY;
1..2
not 
ok 1
ok 2
DUMMY

--- NEW FILE: switches ---
print "1..1\n";
print $INC{'strict.pm'} ? "ok 1\n" : "not ok 1\n";

--- NEW FILE: skipall ---
print <<DUMMY_TEST;
1..0 # skip: rope
DUMMY_TEST

--- NEW FILE: inc_taint ---
#!/usr/bin/perl -Tw

use lib qw(t/lib);
use Test::More tests => 1;

ok( grep(/we_added_this_lib/, @INC) );


--- NEW FILE: skipall_nomsg ---
print "1..0\n";
exit 0;

--- NEW FILE: todo ---
print <<DUMMY_TEST;
1..5 todo 3   2;
ok 1
ok 2
not ok 3
ok 4
ok 5
DUMMY_TEST

--- NEW FILE: skip_nomsg ---
print <<DUMMY;
1..1
ok 1 # Skip
DUMMY

--- NEW FILE: with_comments ---
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

--- NEW FILE: taint_warn ---
#!/usr/bin/perl -tw

use lib qw(t/lib);
use Test::More tests => 1;

my $warnings = '';
{
    local $SIG{__WARN__} = sub { $warnings .= join '', @_ };
    kill 0, $^X;
}
like( $warnings, '/^Insecure dependency/',   '-t honored' );

--- NEW FILE: out_of_order ---
# 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

--- NEW FILE: head_fail ---
print <<DUMMY_TEST;
# comments
ok 1
not ok 2
ok 3
ok 4
# comment
1..4
# more ignored stuff
# and yet more
DUMMY_TEST

--- NEW FILE: bailout ---
print <<DUMMY_TEST;
1..5
ok 1
ok 2
ok 3
Bail out!  GERONIMMMOOOOOO!!!
ok 4
ok 5
DUMMY_TEST

--- NEW FILE: no_nums ---
print <<DUMMY_TEST;
1..5
ok
ok
not ok
ok
ok
DUMMY_TEST

--- NEW FILE: combined ---
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

--- NEW FILE: todo_inline ---
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

--- NEW FILE: lone_not_bug ---
# 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

--- NEW FILE: die_last_minute ---
print <<DUMMY_TEST;
ok 1
ok 2
ok 3
ok 4
1..4
DUMMY_TEST

use if $^O eq 'VMS', vmsish => 'hushed';
exit 1;

--- NEW FILE: descriptive ---
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

--- NEW FILE: shbang_misparse ---
#!/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";

--- NEW FILE: head_end ---
print <<DUMMY_TEST;
# comments
ok 1
ok 2
ok 3
ok 4
# comment
1..4
# more ignored stuff
# and yet more
DUMMY_TEST

--- NEW FILE: segfault ---
#!/usr/bin/perl

print "1..1\n";
print "ok 1\n";
kill 11, $$;

--- NEW FILE: die_head_end ---
print <<DUMMY_TEST;
ok 1
ok 2
ok 3
ok 4
DUMMY_TEST

use if $^O eq 'VMS', vmsish => 'hushed';
exit 1;

--- NEW FILE: die ---
use if ($^O eq 'VMS'), vmsish => 'hushed';
exit 1;  # exit because die() can be noisy

--- NEW FILE: taint ---
#!/usr/bin/perl -Tw

use lib qw(t/lib);
use Test::More tests => 1;

eval { kill 0, $^X };
like( $@, '/^Insecure dependency/',   '-T honored' );

--- NEW FILE: duplicates ---
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

--- NEW FILE: bignum_many ---
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




More information about the dslinux-commit mailing list