/usr/share/doc/perl-Test-Simple/t/Legacy
NameSizeModeActions
Bugs/-0755rm
Builder/-0755rm
Regression/-0755rm
Simple/-0755rm
subtest/-0755rm
Test2/-0755rm
Tester/-0755rm
00test_harness_check.t7640644editdlrm
01-basic.t900644editdlrm
478-cmp_ok_hash.t9230644editdlrm
auto.t5980644editdlrm
bad_plan.t4950644editdlrm
bail_out.t8510644editdlrm
BEGIN_require_ok.t4630644editdlrm
BEGIN_use_ok.t3880644editdlrm
buffer.t4440644editdlrm
capture.t4880644editdlrm
check_tests.t24370644editdlrm
circular_data.t12000644editdlrm
cmp_ok.t17940644editdlrm
c_flag.t4580644editdlrm
depth.t3830644editdlrm
diag.t14240644editdlrm
died.t8890644editdlrm
dont_overwrite_die_handler.t5150644editdlrm
eq_set.t5620644editdlrm
exit.t32420644editdlrm
explain.t5820644editdlrm
explain_err_vars.t1220644editdlrm
extra.t11380644editdlrm
extra_one.t9100644editdlrm
fail-like.t15950644editdlrm
fail-more.t108040644editdlrm
fail.t12460644editdlrm
fail_one.t8730644editdlrm
filehandles.t2900644editdlrm
fork.t4560644editdlrm
harness_active.t14610644editdlrm
import.t2440644editdlrm
is_deeply_dne_bug.t8870644editdlrm
is_deeply_fail.t117920644editdlrm
is_deeply_with_threads.t14010644editdlrm
missing.t11010644editdlrm
More.t52180644editdlrm
new_ok.t7050644editdlrm
note.t4160644editdlrm
no_log_results.t2600644editdlrm
no_plan.t8400644editdlrm
no_tests.t8230644editdlrm
overload.t21810644editdlrm
overload_threads.t11780644editdlrm
plan.t4740644editdlrm
plan_bad.t10720644editdlrm
plan_is_noplan.t4040644editdlrm
plan_no_plan.t7940644editdlrm
plan_shouldnt_import.t2940644editdlrm
plan_skip_all.t1900644editdlrm
require_ok.t7860644editdlrm
run_test.t42310644editdlrm
simple.t2000644editdlrm
skip.t19650644editdlrm
skipall.t4810644editdlrm
strays.t4800644editdlrm
tbm_doesnt_set_exported_to.t4570644editdlrm
threads.t6160644editdlrm
thread_taint.t1220644editdlrm
todo.t33600644editdlrm
undef.t20010644editdlrm
useing.t3650644editdlrm
use_ok.t23450644editdlrm
utf8.t15230644editdlrm
versions.t5030644editdlrm
Edit: /usr/share/doc/perl-Test-Simple/t/Legacy/is_deeply_fail.t (11792B)
#!/usr/bin/perl -w BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib'; } } use strict; use Test::Builder; require Test::Simple::Catch; my($out, $err) = Test::Simple::Catch::caught(); Test::Builder->new->no_header(1); Test::Builder->new->no_ending(1); local $ENV{HARNESS_ACTIVE} = 0; # Can't use Test.pm, that's a 5.005 thing. package main; my $TB = Test::Builder->create; $TB->plan(tests => 102); # Utility testing functions. sub ok ($;$) { return $TB->ok(@_); } sub is ($$;$) { my($thing, $that, $name) = @_; my $ok = $TB->is_eq($$thing, $that, $name); $$thing = ''; return $ok; } sub like ($$;$) { my($thing, $regex, $name) = @_; $regex = "/$regex/" if !ref $regex and $regex !~ m{^/.*/$}s; my $ok = $TB->like($$thing, $regex, $name); $$thing = ''; return $ok; } require Test::More; Test::More->import(tests => 11, import => ['is_deeply']); my $Filename = quotemeta $0; #line 68 ok !is_deeply('foo', 'bar', 'plain strings'); is( $out, "not ok 1 - plain strings\n", 'plain strings' ); is( $err, < 42 }, { this => 43 }, 'hashes with different values'); is( $out, "not ok 3 - hashes with different values\n", 'hashes with different values' ); is( $err, <{this} = '42' # \$expected->{this} = '43' ERR #line 99 ok !is_deeply({ that => 42 }, { this => 42 }, 'hashes with different keys'); is( $out, "not ok 4 - hashes with different keys\n", 'hashes with different keys' ); is( $err, <{this} = Does not exist # \$expected->{this} = '42' ERR #line 110 ok !is_deeply([1..9], [1..10], 'arrays of different length'); is( $out, "not ok 5 - arrays of different length\n", 'arrays of different length' ); is( $err, <[9] = Does not exist # \$expected->[9] = '10' ERR #line 121 ok !is_deeply([undef, undef], [undef], 'arrays of undefs' ); is( $out, "not ok 6 - arrays of undefs\n", 'arrays of undefs' ); is( $err, <[1] = undef # \$expected->[1] = Does not exist ERR #line 131 ok !is_deeply({ foo => undef }, {}, 'hashes of undefs' ); is( $out, "not ok 7 - hashes of undefs\n", 'hashes of undefs' ); is( $err, <{foo} = undef # \$expected->{foo} = Does not exist ERR #line 141 ok !is_deeply(\42, \23, 'scalar refs'); is( $out, "not ok 8 - scalar refs\n", 'scalar refs' ); is( $err, < \$a3 }; # $b2 = { foo => \$b3 }; # is_deeply([$a1], [$b1], 'deep mixed scalar refs'); my $foo = { this => [1..10], that => { up => "down", left => "right" }, }; my $bar = { this => [1..10], that => { up => "down", left => "right", foo => 42 }, }; #line 198 ok !is_deeply( $foo, $bar, 'deep structures' ); ok( @Test::More::Data_Stack == 0, '@Data_Stack not holding onto things' ); is( $out, "not ok 11 - deep structures\n", 'deep structures' ); is( $err, <{that}{foo} = Does not exist # \$expected->{that}{foo} = '42' ERR #line 221 my @tests = ([], [qw(42)], [qw(42 23), qw(42 23)] ); foreach my $test (@tests) { my $num_args = @$test; my $warning; local $SIG{__WARN__} = sub { $warning .= join '', @_; }; ok !is_deeply(@$test); like \$warning, "/^is_deeply\\(\\) takes two or three args, you gave $num_args\.\n/"; } #line 240 # [rt.cpan.org 6837] ok !is_deeply([{Foo => undef}],[{Foo => ""}]), 'undef != ""'; ok( @Test::More::Data_Stack == 0, '@Data_Stack not holding onto things' ); #line 258 # [rt.cpan.org 7031] my $a = []; ok !is_deeply($a, $a.''), "don't compare refs like strings"; ok !is_deeply([$a], [$a.'']), " even deep inside"; #line 265 # [rt.cpan.org 7030] ok !is_deeply( {}, {key => []} ), '[] could match non-existent values'; ok !is_deeply( [], [[]] ); #line 273 $$err = $$out = ''; ok !is_deeply( [\'a', 'b'], [\'a', 'c'] ); is( $out, "not ok 20\n", 'scalar refs in an array' ); is( $err, <[1] = 'b' # \$expected->[1] = 'c' ERR #line 285 my $ref = \23; ok !is_deeply( 23, $ref ); is( $out, "not ok 21\n", 'scalar vs ref' ); is( $err, <[0] = $array # \$expected->[0] = $hash ERR # Overloaded object tests { my $foo = bless [], "Foo"; my $bar = bless {}, "Bar"; { package Bar; "overload"->import(q[""] => sub { "wibble" }); } #line 353 ok !is_deeply( [$foo], [$bar] ); is( $out, "not ok 26\n", 'string overloaded refs respected in diag' ); is( $err, <[0] = $foo # \$expected->[0] = 'wibble' ERR } } # rt.cpan.org 14746 { # line 349 ok !is_deeply( sub {"foo"}, sub {"bar"} ), 'function refs'; is( $out, "not ok 27\n" ); like( $err, < 0}, {x => ''}, "{x => 0} != {x => ''}" ); is( $out, "not ok 39 - {x => 0} != {x => ''}\n" ); ok !is_deeply( {x => 0}, {x => undef}, "{x => 0} != {x => undef}" ); is( $out, "not ok 40 - {x => 0} != {x => undef}\n" ); ok !is_deeply( {x => ''}, {x => undef}, "{x => ''} != {x => undef}" ); is( $out, "not ok 41 - {x => ''} != {x => undef}\n" ); } # this will also happily fail before 5.10, even though there's no VSTRING ref type { my $version1 = v1.2.3; my $version2 = v1.2.4; ok !is_deeply( [\\$version1], [\\$version2], "version objects"); is( $out, "not ok 42 - version objects\n" ); }