[ SYSTEM ]: Linux srv.persadacompanies.com 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
[ SERVER ]: Apache | PHP: 8.4.20
[ USER ]: persadamedika | IP: 45.64.1.108
GEFORCE FILE MANAGER
/
usr
/
share
/
doc
/
perl-Test-Simple
/
t
/
Legacy
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📁 Bugs
SET
[ DEL ]
📁 Builder
SET
[ DEL ]
📁 Regression
SET
[ DEL ]
📁 Simple
SET
[ DEL ]
📁 Test2
SET
[ DEL ]
📁 Tester
SET
[ DEL ]
📁 subtest
SET
[ DEL ]
📄 00test_harness_check.t
764 B
SET
[ EDIT ]
|
[ DEL ]
📄 01-basic.t
90 B
SET
[ EDIT ]
|
[ DEL ]
📄 478-cmp_ok_hash.t
923 B
SET
[ EDIT ]
|
[ DEL ]
📄 BEGIN_require_ok.t
463 B
SET
[ EDIT ]
|
[ DEL ]
📄 BEGIN_use_ok.t
388 B
SET
[ EDIT ]
|
[ DEL ]
📄 More.t
5,218 B
SET
[ EDIT ]
|
[ DEL ]
📄 auto.t
598 B
SET
[ EDIT ]
|
[ DEL ]
📄 bad_plan.t
495 B
SET
[ EDIT ]
|
[ DEL ]
📄 bail_out.t
851 B
SET
[ EDIT ]
|
[ DEL ]
📄 buffer.t
444 B
SET
[ EDIT ]
|
[ DEL ]
📄 c_flag.t
458 B
SET
[ EDIT ]
|
[ DEL ]
📄 capture.t
488 B
SET
[ EDIT ]
|
[ DEL ]
📄 check_tests.t
2,437 B
SET
[ EDIT ]
|
[ DEL ]
📄 circular_data.t
1,200 B
SET
[ EDIT ]
|
[ DEL ]
📄 cmp_ok.t
1,794 B
SET
[ EDIT ]
|
[ DEL ]
📄 depth.t
383 B
SET
[ EDIT ]
|
[ DEL ]
📄 diag.t
1,424 B
SET
[ EDIT ]
|
[ DEL ]
📄 died.t
889 B
SET
[ EDIT ]
|
[ DEL ]
📄 dont_overwrite_die_handler.t
515 B
SET
[ EDIT ]
|
[ DEL ]
📄 eq_set.t
562 B
SET
[ EDIT ]
|
[ DEL ]
📄 exit.t
3,242 B
SET
[ EDIT ]
|
[ DEL ]
📄 explain.t
582 B
SET
[ EDIT ]
|
[ DEL ]
📄 explain_err_vars.t
122 B
SET
[ EDIT ]
|
[ DEL ]
📄 extra.t
1,138 B
SET
[ EDIT ]
|
[ DEL ]
📄 extra_one.t
910 B
SET
[ EDIT ]
|
[ DEL ]
📄 fail-like.t
1,595 B
SET
[ EDIT ]
|
[ DEL ]
📄 fail-more.t
10,804 B
SET
[ EDIT ]
|
[ DEL ]
📄 fail.t
1,246 B
SET
[ EDIT ]
|
[ DEL ]
📄 fail_one.t
873 B
SET
[ EDIT ]
|
[ DEL ]
📄 filehandles.t
290 B
SET
[ EDIT ]
|
[ DEL ]
📄 fork.t
456 B
SET
[ EDIT ]
|
[ DEL ]
📄 harness_active.t
1,461 B
SET
[ EDIT ]
|
[ DEL ]
📄 import.t
244 B
SET
[ EDIT ]
|
[ DEL ]
📄 is_deeply_dne_bug.t
887 B
SET
[ EDIT ]
|
[ DEL ]
📄 is_deeply_fail.t
11,792 B
SET
[ EDIT ]
|
[ DEL ]
📄 is_deeply_with_threads.t
1,401 B
SET
[ EDIT ]
|
[ DEL ]
📄 missing.t
1,101 B
SET
[ EDIT ]
|
[ DEL ]
📄 new_ok.t
705 B
SET
[ EDIT ]
|
[ DEL ]
📄 no_log_results.t
260 B
SET
[ EDIT ]
|
[ DEL ]
📄 no_plan.t
840 B
SET
[ EDIT ]
|
[ DEL ]
📄 no_tests.t
823 B
SET
[ EDIT ]
|
[ DEL ]
📄 note.t
416 B
SET
[ EDIT ]
|
[ DEL ]
📄 overload.t
2,181 B
SET
[ EDIT ]
|
[ DEL ]
📄 overload_threads.t
1,178 B
SET
[ EDIT ]
|
[ DEL ]
📄 plan.t
474 B
SET
[ EDIT ]
|
[ DEL ]
📄 plan_bad.t
1,072 B
SET
[ EDIT ]
|
[ DEL ]
📄 plan_is_noplan.t
404 B
SET
[ EDIT ]
|
[ DEL ]
📄 plan_no_plan.t
794 B
SET
[ EDIT ]
|
[ DEL ]
📄 plan_shouldnt_import.t
294 B
SET
[ EDIT ]
|
[ DEL ]
📄 plan_skip_all.t
190 B
SET
[ EDIT ]
|
[ DEL ]
📄 require_ok.t
786 B
SET
[ EDIT ]
|
[ DEL ]
📄 run_test.t
4,231 B
SET
[ EDIT ]
|
[ DEL ]
📄 simple.t
200 B
SET
[ EDIT ]
|
[ DEL ]
📄 skip.t
1,965 B
SET
[ EDIT ]
|
[ DEL ]
📄 skipall.t
481 B
SET
[ EDIT ]
|
[ DEL ]
📄 strays.t
480 B
SET
[ EDIT ]
|
[ DEL ]
📄 tbm_doesnt_set_exported_to.t
457 B
SET
[ EDIT ]
|
[ DEL ]
📄 thread_taint.t
122 B
SET
[ EDIT ]
|
[ DEL ]
📄 threads.t
616 B
SET
[ EDIT ]
|
[ DEL ]
📄 todo.t
3,360 B
SET
[ EDIT ]
|
[ DEL ]
📄 undef.t
2,001 B
SET
[ EDIT ]
|
[ DEL ]
📄 use_ok.t
2,345 B
SET
[ EDIT ]
|
[ DEL ]
📄 useing.t
365 B
SET
[ EDIT ]
|
[ DEL ]
📄 utf8.t
1,523 B
SET
[ EDIT ]
|
[ DEL ]
📄 versions.t
503 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: is_deeply_fail.t
#!/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, <<ERR, ' right diagnostic' ); # Failed test 'plain strings' # at $0 line 68. # got: 'foo' # expected: 'bar' ERR #line 78 ok !is_deeply({}, [], 'different types'); is( $out, "not ok 2 - different types\n", 'different types' ); like( $err, <<ERR, ' right diagnostic' ); # Failed test 'different types' # at $Filename line 78. # Structures begin differing at: # \\\$got = HASH\\(0x[0-9a-f]+\\) # \\\$expected = ARRAY\\(0x[0-9a-f]+\\) ERR #line 88 ok !is_deeply({ this => 42 }, { this => 43 }, 'hashes with different values'); is( $out, "not ok 3 - hashes with different values\n", 'hashes with different values' ); is( $err, <<ERR, ' right diagnostic' ); # Failed test 'hashes with different values' # at $0 line 88. # Structures begin differing at: # \$got->{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, <<ERR, ' right diagnostic' ); # Failed test 'hashes with different keys' # at $0 line 99. # Structures begin differing at: # \$got->{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, <<ERR, ' right diagnostic' ); # Failed test 'arrays of different length' # at $0 line 110. # Structures begin differing at: # \$got->[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, <<ERR, ' right diagnostic' ); # Failed test 'arrays of undefs' # at $0 line 121. # Structures begin differing at: # \$got->[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, <<ERR, ' right diagnostic' ); # Failed test 'hashes of undefs' # at $0 line 131. # Structures begin differing at: # \$got->{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, <<ERR, ' right diagnostic' ); # Failed test 'scalar refs' # at $0 line 141. # Structures begin differing at: # \${ \$got} = '42' # \${\$expected} = '23' ERR #line 151 ok !is_deeply([], \23, 'mixed scalar and array refs'); is( $out, "not ok 9 - mixed scalar and array refs\n", 'mixed scalar and array refs' ); like( $err, <<ERR, ' right diagnostic' ); # Failed test 'mixed scalar and array refs' # at $Filename line 151. # Structures begin differing at: # \\\$got = ARRAY\\(0x[0-9a-f]+\\) # \\\$expected = SCALAR\\(0x[0-9a-f]+\\) ERR my($a1, $a2, $a3); $a1 = \$a2; $a2 = \$a3; $a3 = 42; my($b1, $b2, $b3); $b1 = \$b2; $b2 = \$b3; $b3 = 23; #line 173 ok !is_deeply($a1, $b1, 'deep scalar refs'); is( $out, "not ok 10 - deep scalar refs\n", 'deep scalar refs' ); is( $err, <<ERR, ' right diagnostic' ); # Failed test 'deep scalar refs' # at $0 line 173. # Structures begin differing at: # \${\${ \$got}} = '42' # \${\${\$expected}} = '23' ERR # I don't know how to properly display this structure. # $a2 = { foo => \$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, <<ERR, ' right diagnostic' ); # Failed test 'deep structures' # at $0 line 198. # Structures begin differing at: # \$got->{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, <<ERR, ' right diagnostic' ); # Failed test at $0 line 274. # Structures begin differing at: # \$got->[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, <<ERR, ' right diagnostic'); # Failed test at $0 line 286. # Structures begin differing at: # \$got = '23' # \$expected = $ref ERR #line 296 ok !is_deeply( $ref, 23 ); is( $out, "not ok 22\n", 'ref vs scalar' ); is( $err, <<ERR, ' right diagnostic'); # Failed test at $0 line 296. # Structures begin differing at: # \$got = $ref # \$expected = '23' ERR #line 306 ok !is_deeply( undef, [] ); is( $out, "not ok 23\n", 'is_deeply and undef [RT 9441]' ); like( $err, <<ERR, ' right diagnostic' ); # Failed test at $Filename line 306\\. # Structures begin differing at: # \\\$got = undef # \\\$expected = ARRAY\\(0x[0-9a-f]+\\) ERR # rt.cpan.org 8865 { my $array = []; my $hash = {}; #line 321 ok !is_deeply( $array, $hash ); is( $out, "not ok 24\n", 'is_deeply and different reference types' ); is( $err, <<ERR, ' right diagnostic' ); # Failed test at $0 line 321. # Structures begin differing at: # \$got = $array # \$expected = $hash ERR #line 332 ok !is_deeply( [$array], [$hash] ); is( $out, "not ok 25\n", 'nested different ref types' ); is( $err, <<ERR, ' right diagnostic' ); # Failed test at $0 line 332. # Structures begin differing at: # \$got->[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, <<ERR, ' right diagnostic' ); # Failed test at $0 line 353. # Structures begin differing at: # \$got->[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, <<ERR, ' right diagnostic' ); # Failed test at $Filename line 349. # Structures begin differing at: # \\\$got = CODE\\(0x[0-9a-f]+\\) # \\\$expected = CODE\\(0x[0-9a-f]+\\) ERR use Symbol; my $glob1 = gensym; my $glob2 = gensym; #line 357 ok !is_deeply( $glob1, $glob2 ), 'typeglobs'; is( $out, "not ok 28\n" ); like( $err, <<ERR, ' right diagnostic' ); # Failed test at $Filename line 357. # Structures begin differing at: # \\\$got = GLOB\\(0x[0-9a-f]+\\) # \\\$expected = GLOB\\(0x[0-9a-f]+\\) ERR } # rt.cpan.org 53469 { # Accept both old and new-style stringification my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism'; #line 380 ok !is_deeply( qr/a/, qr/b/, "different regexes" ); is( $out, "not ok 29 - different regexes\n" ); is( $err, <<ERR, ' right diagnostic' ); # Failed test 'different regexes' # at $0 line 380. # Structures begin differing at: # \$got = (?$modifiers:a) # \$expected = (?$modifiers:b) ERR } # false values that should not compare equal { ok !is_deeply( 0, '', "0 != ''" ); is( $out, "not ok 30 - 0 != ''\n" ); ok !is_deeply( 0, undef, "0 != undef" ); is( $out, "not ok 31 - 0 != undef\n" ); ok !is_deeply( '', undef, "'' != undef" ); is( $out, "not ok 32 - '' != undef\n" ); ok !is_deeply( [0], [''], "[0] != ['']" ); is( $out, "not ok 33 - [0] != ['']\n" ); ok !is_deeply( [0], [undef], "[0] != [undef]" ); is( $out, "not ok 34 - [0] != [undef]\n" ); ok !is_deeply( [''], [undef], "[''] != [undef]" ); is( $out, "not ok 35 - [''] != [undef]\n" ); ok !is_deeply( [0], [], "[0] != []" ); is( $out, "not ok 36 - [0] != []\n" ); ok !is_deeply( [undef], [], "[undef] != []" ); is( $out, "not ok 37 - [undef] != []\n" ); ok !is_deeply( [''], [], "[''] != []" ); is( $out, "not ok 38 - [''] != []\n" ); ok !is_deeply( {x => 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" ); }