/usr/share/doc/perl-Test-Simple/t/Legacy
#!perl -w use Test2::Util qw/CAN_THREAD/; BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib'; } } chdir 't'; BEGIN { # There was a bug with overloaded objects and threads. # See rt.cpan.org 4218 eval { require threads; 'threads'->import; 1; } if CAN_THREAD; } use Test::More; plan skip_all => "known to crash on $]" if $] le "5.006002"; plan tests => 5; package Overloaded; use overload q{""} => sub { $_[0]->{string} }; sub new { my $class = shift; bless { string => shift }, $class; } package main; my $warnings = ''; local $SIG{__WARN__} = sub { $warnings = join '', @_ }; # overloaded object as name my $obj = Overloaded->new('foo'); ok( 1, $obj ); # overloaded object which returns undef as name my $undef = Overloaded->new(undef); pass( $undef ); is( $warnings, '' ); TODO: { my $obj = Overloaded->new('not really todo, testing overloaded reason'); local $TODO = $obj; fail("Just checking todo as an overloaded value"); } SKIP: { my $obj = Overloaded->new('not really skipped, testing overloaded reason'); skip $obj, 1; }
.
Edit
..
Edit
00test_harness_check.t
Edit
01-basic.t
Edit
478-cmp_ok_hash.t
Edit
BEGIN_require_ok.t
Edit
BEGIN_use_ok.t
Edit
Bugs
Edit
Builder
Edit
More.t
Edit
Regression
Edit
Simple
Edit
Test2
Edit
Tester
Edit
auto.t
Edit
bad_plan.t
Edit
bail_out.t
Edit
buffer.t
Edit
c_flag.t
Edit
capture.t
Edit
check_tests.t
Edit
circular_data.t
Edit
cmp_ok.t
Edit
depth.t
Edit
diag.t
Edit
died.t
Edit
dont_overwrite_die_handler.t
Edit
eq_set.t
Edit
exit.t
Edit
explain.t
Edit
explain_err_vars.t
Edit
extra.t
Edit
extra_one.t
Edit
fail-like.t
Edit
fail-more.t
Edit
fail.t
Edit
fail_one.t
Edit
filehandles.t
Edit
fork.t
Edit
harness_active.t
Edit
import.t
Edit
is_deeply_dne_bug.t
Edit
is_deeply_fail.t
Edit
is_deeply_with_threads.t
Edit
missing.t
Edit
new_ok.t
Edit
no_log_results.t
Edit
no_plan.t
Edit
no_tests.t
Edit
note.t
Edit
overload.t
Edit
overload_threads.t
Edit
plan.t
Edit
plan_bad.t
Edit
plan_is_noplan.t
Edit
plan_no_plan.t
Edit
plan_shouldnt_import.t
Edit
plan_skip_all.t
Edit
require_ok.t
Edit
run_test.t
Edit
simple.t
Edit
skip.t
Edit
skipall.t
Edit
strays.t
Edit
subtest
Edit
tbm_doesnt_set_exported_to.t
Edit
thread_taint.t
Edit
threads.t
Edit
todo.t
Edit
undef.t
Edit
use_ok.t
Edit
useing.t
Edit
utf8.t
Edit
versions.t
Edit