diff options
Diffstat (limited to 'cpan/Test-Simple/t/Behavior')
24 files changed, 0 insertions, 1127 deletions
diff --git a/cpan/Test-Simple/t/Behavior/388-threadedsubtest.load b/cpan/Test-Simple/t/Behavior/388-threadedsubtest.load deleted file mode 100644 index ee341250e8..0000000000 --- a/cpan/Test-Simple/t/Behavior/388-threadedsubtest.load +++ /dev/null @@ -1,3 +0,0 @@ -use Test::More; -ok(1,"name"); -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/388-threadedsubtest.t b/cpan/Test-Simple/t/Behavior/388-threadedsubtest.t deleted file mode 100644 index fae3783f0e..0000000000 --- a/cpan/Test-Simple/t/Behavior/388-threadedsubtest.t +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; - -use Test::CanThread qw/AUTHOR_TESTING/; -use Test::More; - -subtest my_subtest => sub { - my $file = __FILE__; - $file =~ s/\.t$/.load/; - do $file || die $@; -}; - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/478-cmp_ok_hash.t b/cpan/Test-Simple/t/Behavior/478-cmp_ok_hash.t deleted file mode 100644 index ae82249caf..0000000000 --- a/cpan/Test-Simple/t/Behavior/478-cmp_ok_hash.t +++ /dev/null @@ -1,36 +0,0 @@ -use strict; -use warnings; -use Test::More; - -use Test::Stream::Tester; - -my $want = 0; -my $got = 0; - -cmp_ok($got, 'eq', $want, "Passes on correct comparison"); - -my @warn; -my $events = intercept { - no warnings 'redefine'; - local $SIG{__WARN__} = sub { - push @warn => @_; - }; - cmp_ok($got, '#eq', $want, "You shall not pass!"); -}; - -# We are not going to inspect the warning because it is not super predictable, -# and changes with eval specifics. -ok(@warn, "We got warnings"); - -events_are( - $events, - check { - event ok => { - bool => 0, - diag => qr/syntax error at \(eval in cmp_ok\)/, - }; - }, - "Events meet expectations" -); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/490-inherit_exporter.t b/cpan/Test-Simple/t/Behavior/490-inherit_exporter.t deleted file mode 100644 index b899bfecd0..0000000000 --- a/cpan/Test-Simple/t/Behavior/490-inherit_exporter.t +++ /dev/null @@ -1,25 +0,0 @@ -use strict; -use warnings; - - -BEGIN { - $INC{'My/Tester.pm'} = __FILE__; - package My::Tester; - use Test::More; - use base 'Test::More'; - - our @EXPORT = (@Test::More::EXPORT, qw/foo/); - our @EXPORT_OK = (@Test::More::EXPORT_OK); - - sub foo { goto &Test::More::ok } - - 1; -} - -use My::Tester; - -can_ok(__PACKAGE__, qw/ok done_testing foo/); - -foo(1, "This is just an ok"); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/CustomOutput.t b/cpan/Test-Simple/t/Behavior/CustomOutput.t deleted file mode 100644 index e4d7185809..0000000000 --- a/cpan/Test-Simple/t/Behavior/CustomOutput.t +++ /dev/null @@ -1,137 +0,0 @@ -use strict; -use warnings; - -use Test::Stream; -use Test::More; -use Scalar::Util qw/blessed/; - -# This will replace the main Test::Stream object for the scope of the coderef. -# We apply our output changes only in that scope so that this test itself can -# verify things with regular TAP output. The things done inside thise sub would -# work just fine when used by any module to alter the output. - -my @OUTPUT; -Test::Stream->intercept(sub { - # Turn off normal TAP output - Test::Stream->shared->set_use_tap(0); - - # Turn off legacy storage of results. - Test::Stream->shared->set_use_legacy(0); - - Test::Stream->shared->listen(sub { - my ($stream, $event) = @_; - - push @OUTPUT => "We got an event of type " . blessed($event); - }); - - # Now we run some tests, no TAP will be produced, instead all events will - # be added to @OUTPUT. - - ok(1, "pass"); - ok(0, "fail"); - - subtest foo => sub { - ok(1, "pass"); - ok(0, "fail"); - }; - - diag "Hello"; -}); - -is_deeply( - \@OUTPUT, - [ - 'We got an event of type Test::Stream::Event::Ok', - 'We got an event of type Test::Stream::Event::Ok', - 'We got an event of type Test::Stream::Event::Note', - 'We got an event of type Test::Stream::Event::Subtest', - 'We got an event of type Test::Stream::Event::Diag', - ], - "Got all events" -); - -# Now for something more complicated, lets have everything be normal TAP, -# except subtests - -my (@STDOUT, @STDERR, @TODO); -my @IO = (\@STDOUT, \@STDERR, \@TODO); - -Test::Stream->intercept(sub { - # Turn off normal TAP output - Test::Stream->shared->set_use_tap(0); - - # Turn off legacy storage of results. - Test::Stream->shared->set_use_legacy(0); - - my $number = 1; - Test::Stream->shared->listen(sub { - my ($stream, $e) = @_; - - # Do not output results inside subtests - return if $e->in_subtest; - - return unless $e->can('to_tap'); - - my $num = $stream->use_numbers ? $number++ : undef; - - # Get the TAP for the event - my @sets; - if ($e->isa('Test::Stream::Event::Subtest')) { - # Subtest is a subclass of Ok, use Ok's to_tap method: - @sets = Test::Stream::Event::Ok::to_tap($e, $num); - # Here you can also add whatever output you want. - } - else { - @sets = $e->to_tap($num); - } - - for my $set (@sets) { - my ($hid, $msg) = @$set; - next unless $msg; - my $enc = $e->encoding || die "Could not find encoding!"; - - # This is how you get the proper handle to use (STDERR, STDOUT, ETC). - my $io = $stream->io_sets->{$enc}->[$hid] || die "Could not find IO $hid for $enc"; - $io = $IO[$hid]; - - # Make sure we don't alter these vars. - local($\, $", $,) = (undef, ' ', ''); - - # Normally you print to the IO, but here we are pushing to arrays - chomp($msg); - push @$io => $msg; - } - }); - - # Now we run some tests, no TAP will be produced, instead all events will - # be added to our ourputs - - ok(1, "pass"); - ok(0, "fail"); - - subtest foo => sub { - ok(1, "pass"); - ok(0, "fail"); - }; - - diag "Hello"; -}); - -is(@TODO, 0, "No TODO output"); - -is_deeply( - \@STDOUT, - [ - 'ok 1 - pass', - 'not ok 2 - fail', - '# Subtest: foo', - # As planned, none of the events inside the subtest got rendered. - 'not ok 4 - foo' - ], - "Got expected TAP" -); - -is(pop(@STDERR), "# Hello", "Got the hello diag"); -is(@STDERR, 2, "got diag for 2 failed tests"); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/MonkeyPatching_diag.t b/cpan/Test-Simple/t/Behavior/MonkeyPatching_diag.t deleted file mode 100644 index e89f02cc97..0000000000 --- a/cpan/Test-Simple/t/Behavior/MonkeyPatching_diag.t +++ /dev/null @@ -1,106 +0,0 @@ -use strict; -use warnings; -use B; - -use Test::Stream; -use Test::MostlyLike; -use Test::More tests => 3; -use Test::Builder; # Not loaded by default in modern mode -my $orig = Test::Builder->can('diag'); - -{ - package MyModernTester; - use Test::More; - use Test::Stream; - use Test::MostlyLike; - use Test::Stream::Tester qw/intercept/; - - no warnings 'redefine'; - local *Test::Builder::diag = sub { - my $self = shift; - return $self->$orig(__PACKAGE__ . ": ", @_); - }; - use warnings; - - my $file = __FILE__; - # Line number is tricky, just use what B says The sub may not actually think it - # is on the line it is may be off by 1. - my $line = B::svref_2object(\&Test::Builder::diag)->START->line; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - intercept { - diag('first'); - diag('seconds'); - }; - } - mostly_like( - \@warnings, - [ - qr{The new sub is 'MyModernTester::__ANON__' defined in \Q$file\E around line $line}, - undef, #Only 1 warning - ], - "Found expected warning, just the one" - ); -} - -{ - package MyModernTester2; - use Test::More; - use Test::Stream; - use Test::MostlyLike; - use Test::Stream::Tester qw/intercept/; - - no warnings 'redefine'; - local *Test::Builder::diag = sub { - my $self = shift; - return $self->$orig(__PACKAGE__ . ": ", @_); - }; - use warnings; - - my $file = __FILE__; - # Line number is tricky, just use what B says The sub may not actually think it - # is on the line it is may be off by 1. - my $line = B::svref_2object(\&Test::Builder::diag)->START->line; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - intercept { - diag('first'); - diag('seconds'); - }; - } - mostly_like( - \@warnings, - [ - qr{The new sub is 'MyModernTester2::__ANON__' defined in \Q$file\E around line $line}, - undef, #Only 1 warning - ], - "new override, new warning" - ); -} - -{ - package MyLegacyTester; - use Test::More; - use Test::Stream::Tester qw/intercept/; - - no warnings 'redefine'; - local *Test::Builder::diag = sub { - my $self = shift; - return $self->$orig(__PACKAGE__ . ": ", @_); - }; - use warnings; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - intercept { - diag('first'); - diag('seconds'); - }; - } - is(@warnings, 0, "no warnings for a legacy tester"); -} diff --git a/cpan/Test-Simple/t/Behavior/MonkeyPatching_done_testing.t b/cpan/Test-Simple/t/Behavior/MonkeyPatching_done_testing.t deleted file mode 100644 index 8c62100d07..0000000000 --- a/cpan/Test-Simple/t/Behavior/MonkeyPatching_done_testing.t +++ /dev/null @@ -1,61 +0,0 @@ -use strict; -use warnings; -use B; - -use Test::Stream; -use Test::MostlyLike; -use Test::More tests => 4; -use Test::Builder; # Not loaded by default in modern mode -my $orig = Test::Builder->can('done_testing'); - -use Test::Stream::Tester; - -my $ran = 0; -no warnings 'redefine'; -my $file = __FILE__; -my $line = __LINE__ + 1; -*Test::Builder::done_testing = sub { my $self = shift; $ran++; $self->$orig(@_) }; -use warnings; - -my @warnings; -$SIG{__WARN__} = sub { push @warnings => @_ }; - -events_are( - intercept { - ok(1, "pass"); - ok(0, "fail"); - - done_testing; - }, - check { - event ok => { bool => 1 }; - event ok => { bool => 0 }; - event plan => { max => 2 }; - directive 'end'; - }, -); - -events_are( - intercept { - ok(1, "pass"); - ok(0, "fail"); - - done_testing; - }, - check { - event ok => { bool => 1 }; - event ok => { bool => 0 }; - event plan => { max => 2 }; - directive 'end'; - }, -); - -is($ran, 2, "We ran our override both times"); -mostly_like( - \@warnings, - [ - qr{The new sub is 'main::__ANON__' defined in \Q$file\E around line $line}, - undef, - ], - "Got the warning once" -); diff --git a/cpan/Test-Simple/t/Behavior/MonkeyPatching_note.t b/cpan/Test-Simple/t/Behavior/MonkeyPatching_note.t deleted file mode 100644 index 7c8e765629..0000000000 --- a/cpan/Test-Simple/t/Behavior/MonkeyPatching_note.t +++ /dev/null @@ -1,97 +0,0 @@ -use strict; -use warnings; -use B; - -use Test::Stream; -use Test::MostlyLike; -use Test::More tests => 3; -use Test::Builder; # Not loaded by default in modern mode -my $orig = Test::Builder->can('note'); - -{ - package MyModernTester; - use Test::More; - use Test::Stream; - use Test::MostlyLike; - - no warnings 'redefine'; - local *Test::Builder::note = sub { - my $self = shift; - return $self->$orig(__PACKAGE__ . ": ", @_); - }; - use warnings; - - my $file = __FILE__; - # Line number is tricky, just use what B says The sub may not actually think it - # is on the line it is may be off by 1. - my $line = B::svref_2object(\&Test::Builder::note)->START->line; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - note('first'); - note('seconds'); - } - mostly_like( - \@warnings, - [ - qr{The new sub is 'MyModernTester::__ANON__' defined in \Q$file\E around line $line}, - undef, #Only 1 warning - ], - "Found expected warning, just the one" - ); -} - -{ - package MyModernTester2; - use Test::More; - use Test::Stream; - use Test::MostlyLike; - - no warnings 'redefine'; - local *Test::Builder::note = sub { - my $self = shift; - return $self->$orig(__PACKAGE__ . ": ", @_); - }; - use warnings; - - my $file = __FILE__; - # Line number is tricky, just use what B says The sub may not actually think it - # is on the line it is may be off by 1. - my $line = B::svref_2object(\&Test::Builder::note)->START->line; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - note('first'); - note('seconds'); - } - mostly_like( - \@warnings, - [ - qr{The new sub is 'MyModernTester2::__ANON__' defined in \Q$file\E around line $line}, - undef, #Only 1 warning - ], - "new override, new warning" - ); -} - -{ - package MyLegacyTester; - use Test::More; - - no warnings 'redefine'; - local *Test::Builder::note = sub { - my $self = shift; - return $self->$orig(__PACKAGE__ . ": ", @_); - }; - use warnings; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - note('first'); - note('seconds'); - } - is(@warnings, 0, "no warnings for a legacy tester"); -} diff --git a/cpan/Test-Simple/t/Behavior/MonkeyPatching_ok.t b/cpan/Test-Simple/t/Behavior/MonkeyPatching_ok.t deleted file mode 100644 index faf92bfc45..0000000000 --- a/cpan/Test-Simple/t/Behavior/MonkeyPatching_ok.t +++ /dev/null @@ -1,108 +0,0 @@ -use strict; -use warnings; -use B; - -use Test::Stream; -use Test::MostlyLike; -use Test::More tests => 9; -use Test::Builder; # Not loaded by default in modern mode -my $orig = Test::Builder->can('ok'); - -{ - package MyModernTester; - use Test::Stream; - use Test::MostlyLike; - use Test::More; - - no warnings 'redefine'; - local *Test::Builder::ok = sub { - my $self = shift; - my ($bool, $name) = @_; - $name = __PACKAGE__ . ": $name"; - return $self->$orig($bool, $name); - }; - use warnings; - - my $file = __FILE__; - # Line number is tricky, just use what B says The sub may not actually think it - # is on the line it is may be off by 1. - my $line = B::svref_2object(\&Test::Builder::ok)->START->line; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - ok(1, "fred"); - ok(2, "barney"); - } - mostly_like( - \@warnings, - [ - qr{The new sub is 'MyModernTester::__ANON__' defined in \Q$file\E around line $line}, - undef, #Only 1 warning - ], - "Found expected warning, just the one" - ); -} - -{ - package MyModernTester2; - use Test::Stream; - use Test::MostlyLike; - use Test::More; - - no warnings 'redefine'; - local *Test::Builder::ok = sub { - my $self = shift; - my ($bool, $name) = @_; - $name = __PACKAGE__ . ": $name"; - return $self->$orig($bool, $name); - }; - use warnings; - - my $file = __FILE__; - # Line number is tricky, just use what B says The sub may not actually think it - # is on the line it is may be off by 1. - my $line = B::svref_2object(\&Test::Builder::ok)->START->line; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - ok(1, "fred"); - ok(2, "barney"); - } - mostly_like( - \@warnings, - [ - qr{The new sub is 'MyModernTester2::__ANON__' defined in \Q$file\E around line $line}, - undef, #Only 1 warning - ], - "new override, new warning" - ); -} - -{ - package MyLegacyTester; - use Test::More; - - no warnings 'redefine'; - local *Test::Builder::ok = sub { - my $self = shift; - my ($bool, $name) = @_; - $name = __PACKAGE__ . ": $name"; - return $self->$orig($bool, $name); - }; - use warnings; - - my $file = __FILE__; - # Line number is tricky, just use what B says The sub may not actually think it - # is on the line it is may be off by 1. - my $line = B::svref_2object(\&Test::Builder::ok)->START->line; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings => @_ }; - ok(1, "fred"); - ok(2, "barney"); - } - is(@warnings, 0, "no warnings for a legacy tester"); -} diff --git a/cpan/Test-Simple/t/Behavior/MonkeyPatching_plan.t b/cpan/Test-Simple/t/Behavior/MonkeyPatching_plan.t deleted file mode 100644 index 236a083cbf..0000000000 --- a/cpan/Test-Simple/t/Behavior/MonkeyPatching_plan.t +++ /dev/null @@ -1,115 +0,0 @@ -use strict; -use warnings; -use B; - -use Test::Stream; -use Test::MostlyLike; -use Test::More tests => 8; -use Test::Builder; # Not loaded by default in modern mode -my $orig = Test::Builder->can('plan'); - -use Test::Stream::Tester; - -my $ran = 0; -no warnings 'redefine'; -my $file = __FILE__; -my $line = __LINE__ + 1; -*Test::Builder::plan = sub { my $self = shift; $ran++; $self->$orig(@_) }; -use warnings; - -my @warnings; -$SIG{__WARN__} = sub { push @warnings => @_ }; - -events_are( - intercept { - plan tests => 2; - ok(1, "pass"); - ok(0, "fail"); - }, - check { - event plan => { max => 2 }; - event ok => { bool => 1 }; - event ok => { bool => 0 }; - directive 'end'; - }, -); - -events_are( - intercept { - Test::More->import('tests' => 2); - ok(1, "pass"); - ok(0, "fail"); - }, - check { - event plan => { max => 2 }; - event ok => { bool => 1 }; - event ok => { bool => 0 }; - directive 'end'; - }, -); - -events_are( - intercept { - Test::More->import(skip_all => 'damn'); - ok(1, "pass"); - ok(0, "fail"); - }, - check { - event plan => { max => 0, directive => 'SKIP', reason => 'damn' }; - directive 'end'; - }, -); - -events_are( - intercept { - Test::More->import('no_plan'); - ok(1, "pass"); - ok(0, "fail"); - }, - check { - event plan => { directive => 'NO PLAN' }; - event ok => { bool => 1 }; - event ok => { bool => 0 }; - directive 'end'; - }, -); - -is($ran, 4, "We ran our override each time"); -mostly_like( - \@warnings, - [ - qr{The new sub is 'main::__ANON__' defined in \Q$file\E around line $line}, - undef, - ], - "Got the warning once" -); - - - -no warnings 'redefine'; -*Test::Builder::plan = sub { }; -use warnings; -my $ok; -events_are( - intercept { - $ok = eval { - plan(tests => 1); - plan(tests => 2); - ok(1); - ok(1); - ok(1); - done_testing; - 1; - }; - }, - check { - event ok => { bool => 1 }; - event ok => { bool => 1 }; - event ok => { bool => 1 }; - event plan => { max => 3 }; - directive 'end'; - }, - "Make sure plan monkeypatching does not effect done_testing" -); - -ok($ok, "Did not die"); diff --git a/cpan/Test-Simple/t/Behavior/Munge.t b/cpan/Test-Simple/t/Behavior/Munge.t deleted file mode 100644 index be9aa98d5c..0000000000 --- a/cpan/Test-Simple/t/Behavior/Munge.t +++ /dev/null @@ -1,30 +0,0 @@ -use strict; -use warnings; -use Test::Stream; -use Test::More; -use Test::Stream::Tester; - -events_are( - intercept { - my $id = 0; - Test::Stream->shared->munge(sub { - my ($stream, $e) = @_; - return unless $e->isa('Test::Stream::Event::Ok'); - return if defined $e->name; - $e->set_name( 'flubber: ' . $id++ ); - }); - - ok( 1, "Keep the name" ); - ok( 1 ); - ok( 1, "Already named" ); - ok( 1 ); - }, - check { - event ok => { bool => 1, name => "Keep the name" }; - event ok => { bool => 1, name => "flubber: 0" }; - event ok => { bool => 1, name => "Already named" }; - event ok => { bool => 1, name => "flubber: 1" }; - } -); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/NotTB15.t b/cpan/Test-Simple/t/Behavior/NotTB15.t deleted file mode 100644 index a70992599d..0000000000 --- a/cpan/Test-Simple/t/Behavior/NotTB15.t +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; - -use Test::More; -use Test::Builder; - -# This is just a list of method Test::Builder current does not have that Test::Builder 1.5 does. -my @TB15_METHODS = qw{ - _file_and_line _join_message _make_default _my_exit _reset_todo_state - _result_to_hash _results _todo_state formatter history in_test - no_change_exit_code post_event post_result set_formatter set_plan test_end - test_exit_code test_start test_state -}; - -for my $method (qw/foo bar baz/) { - my $success = !eval { Test::Builder->$method; 1 }; my $line = __LINE__; - my $error = $@; - ok($success, "Threw an exception ($method)"); - is( - $error, - qq{Can't locate object method "$method" via package "Test::Builder" at } . __FILE__ . " line $line.\n", - "Did not auto-create random sub ($method)" - ); -} - -my $file = __FILE__; -for my $method (@TB15_METHODS) { - my $success = !eval { Test::Builder->$method; 1 }; my $line = __LINE__; - my $error = $@; - - ok($success, "Threw an exception ($method)"); - - is($error, <<" EOT", "Got expected error ($method)"); -Can't locate object method "$method" via package "Test::Builder" at $file line $line. - - ************************************************************************* - '$method' is a Test::Builder 1.5 method. Test::Builder 1.5 is a dead branch. - You need to update your code so that it no longer treats Test::Builders - over a specific version number as anything special. - - See: http://blogs.perl.org/users/chad_exodist_granum/2014/03/testmore---new-maintainer-also-stop-version-checking.html - ************************************************************************* - EOT -} - -done_testing; - diff --git a/cpan/Test-Simple/t/Behavior/Tester2_subtest.t b/cpan/Test-Simple/t/Behavior/Tester2_subtest.t deleted file mode 100644 index 6101fbb92a..0000000000 --- a/cpan/Test-Simple/t/Behavior/Tester2_subtest.t +++ /dev/null @@ -1,69 +0,0 @@ -use strict; -use warnings; -use utf8; - -use Test::Stream; -use Test::More; -use Test::Stream::Tester; - -my $events = intercept { - ok(0, "test failure" ); - ok(1, "test success" ); - - subtest 'subtest' => sub { - ok(0, "subtest failure" ); - ok(1, "subtest success" ); - - subtest 'subtest_deeper' => sub { - ok(1, "deeper subtest success" ); - }; - }; - - ok(0, "another test failure" ); - ok(1, "another test success" ); -}; - -events_are( - $events, - - check { - event ok => {bool => 0, diag => qr/Fail/}; - event ok => {bool => 1}; - - event note => {message => 'Subtest: subtest'}; - event subtest => { - name => 'subtest', - bool => 0, - diag => qr/Failed test 'subtest'/, - - events => check { - event ok => {bool => 0}; - event ok => {bool => 1}; - - event note => {message => 'Subtest: subtest_deeper'}; - event subtest => { - bool => 1, - name => 'subtest_deeper', - events => check { - event ok => { bool => 1 }; - }, - }; - - event plan => { max => 3 }; - event finish => { tests_run => 3, tests_failed => 1 }; - event diag => { message => qr/Looks like you failed 1 test of 3/ }; - - dir end => 'End of subtests events'; - }, - }; - - event ok => {bool => 0}; - event ok => {bool => 1}; - - dir end => "subtest events as expected"; - }, - - "Subtest events" -); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/cmp_ok_undef.t b/cpan/Test-Simple/t/Behavior/cmp_ok_undef.t deleted file mode 100644 index 1e317c55d1..0000000000 --- a/cpan/Test-Simple/t/Behavior/cmp_ok_undef.t +++ /dev/null @@ -1,19 +0,0 @@ -use Test::More; -use strict; -use warnings; - -use Test::Stream::Tester; - -my @warnings; -local $SIG{__WARN__} = sub { push @warnings => @_ }; -my @events = intercept { cmp_ok( undef, '==', 6 ) }; - -is(@warnings, 1, "1 warning"); - -like( - $warnings[0], - qr/Use of uninitialized value .* at \(eval in cmp_ok\)/, - "Got the expected warning" -); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/cmp_ok_xor.t b/cpan/Test-Simple/t/Behavior/cmp_ok_xor.t deleted file mode 100644 index 292f7168be..0000000000 --- a/cpan/Test-Simple/t/Behavior/cmp_ok_xor.t +++ /dev/null @@ -1,13 +0,0 @@ -use strict; -use warnings; - -use Test::Stream; -use Test::More; - -my @warnings; -$SIG{__WARN__} = sub { push @warnings => @_ }; -my $ok = cmp_ok( 1, 'xor', 0, 'use xor in cmp_ok' ); -ok(!@warnings, "no warnings"); -ok($ok, "returned true"); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/encoding_test.t b/cpan/Test-Simple/t/Behavior/encoding_test.t deleted file mode 100644 index 57242e03d9..0000000000 --- a/cpan/Test-Simple/t/Behavior/encoding_test.t +++ /dev/null @@ -1,35 +0,0 @@ -use strict; -use warnings; -no utf8; - -# line 5 "encoding_tést.t" - -use Test::Stream; -use Test::More; -use Test::Stream::Tester; - -BEGIN { - my $norm = eval { require Unicode::Normalize; require Encode; 1 }; - plan skip_all => 'Unicode::Normalize is required for this test' unless $norm; -} - -my $filename = __FILE__; -ok(!utf8::is_utf8($filename), "filename is not in utf8 yet"); -my $utf8name = Unicode::Normalize::NFKC(Encode::decode('utf8', "$filename", Encode::FB_CROAK)); -ok( $filename ne $utf8name, "sanity check" ); - -my $scoper = sub { context()->snapshot }; - -tap_encoding 'utf8'; -my $ctx_utf8 = $scoper->(); - -tap_encoding 'legacy'; -my $ctx_legacy = $scoper->(); - -is($ctx_utf8->encoding, 'utf8', "got a utf8 context"); -is($ctx_legacy->encoding, 'legacy', "got a legacy context"); - -is($ctx_utf8->file, $utf8name, "Got utf8 name"); -is($ctx_legacy->file, $filename, "Got legacy name"); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/event_clone_args.t b/cpan/Test-Simple/t/Behavior/event_clone_args.t deleted file mode 100644 index 7d4824d550..0000000000 --- a/cpan/Test-Simple/t/Behavior/event_clone_args.t +++ /dev/null @@ -1,22 +0,0 @@ -use Test::More; -use strict; -use warnings; - -use B; -use Test::Stream::Tester qw/intercept/; - -my @events; - -my $x1 = \(my $y1); -push @events => intercept { note $x1 }; -is(B::svref_2object($x1)->REFCNT, 2, "Note does not store a ref"); - -my $x2 = \(my $y2); -push @events => intercept { diag $x2 }; -is(B::svref_2object($x2)->REFCNT, 2, "diag does not store a ref"); - -my $x3 = \(my $y3); -push @events => intercept { ok($x3, "Generating") }; -is(B::svref_2object($x3)->REFCNT, 2, "ok does not store a ref"); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/fork_new_end.t b/cpan/Test-Simple/t/Behavior/fork_new_end.t deleted file mode 100644 index 7e7c2d7c25..0000000000 --- a/cpan/Test-Simple/t/Behavior/fork_new_end.t +++ /dev/null @@ -1,30 +0,0 @@ -use strict; -use warnings; - -BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; - @INC = '../lib'; - } -} - -use Test::CanThread qw/AUTHOR_TESTING/; -use Test::More tests => 4; - -ok(1, "outside before"); - -my $run = sub { - ok(1, 'in thread1'); - ok(1, 'in thread2'); -}; - - -my $t = threads->create($run); - -ok(1, "outside after"); - -$t->join; - -END { - print "XXX: " . Test::Builder->new->is_passing . "\n"; -} diff --git a/cpan/Test-Simple/t/Behavior/skip_all_in_subtest.t b/cpan/Test-Simple/t/Behavior/skip_all_in_subtest.t deleted file mode 100644 index 5f8abea6a6..0000000000 --- a/cpan/Test-Simple/t/Behavior/skip_all_in_subtest.t +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Test::More; - -my @warnings; -local $SIG{__WARN__} = sub { push @warnings, $_[0] }; - -subtest my_subtest1 => sub { - my $file = __FILE__; - $file =~ s/\.t$/1.load/; - do $file; -}; - -is(scalar(@warnings), 1, "one warning"); -like( - $warnings[0], - qr/^SKIP_ALL in subtest via 'BEGIN' or 'use'/, - "the warning" -); - - -subtest my_subtest2 => sub { - my $file = __FILE__; - $file =~ s/\.t$/2.load/; - do $file; -}; - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/skip_all_in_subtest1.load b/cpan/Test-Simple/t/Behavior/skip_all_in_subtest1.load deleted file mode 100644 index 241ce14963..0000000000 --- a/cpan/Test-Simple/t/Behavior/skip_all_in_subtest1.load +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Carp qw/confess/; - -use Test::More skip_all => "Cause I feel like it"; - -confess "Should not see this!"; diff --git a/cpan/Test-Simple/t/Behavior/skip_all_in_subtest2.load b/cpan/Test-Simple/t/Behavior/skip_all_in_subtest2.load deleted file mode 100644 index 6ce306a6de..0000000000 --- a/cpan/Test-Simple/t/Behavior/skip_all_in_subtest2.load +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Carp qw/confess/; - -use Test::More; - -plan skip_all => "Cause I feel like it"; - -confess "Should not see this!"; diff --git a/cpan/Test-Simple/t/Behavior/subtest_die.t b/cpan/Test-Simple/t/Behavior/subtest_die.t deleted file mode 100644 index 49f8f88d9d..0000000000 --- a/cpan/Test-Simple/t/Behavior/subtest_die.t +++ /dev/null @@ -1,35 +0,0 @@ -use strict; -use warnings; -use Test::More; - -use Test::Stream::Tester; - -my ($ok, $err); -events_are( - intercept { - $ok = eval { - subtest foo => sub { - ok(1, "Pass"); - die "Ooops"; - }; - 1; - }; - $err = $@; - }, - check { - directive seek => 1; - event subtest => { - bool => 0, - real_bool => 0, - name => 'foo', - exception => qr/^Ooops/, - }; - directive 'end'; - }, - "Subtest fails if it throws an exception" -); - -ok(!$ok, "subtest died"); -like($err, qr/^Ooops/, "Got expected exception"); - -done_testing; diff --git a/cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t b/cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t deleted file mode 100644 index 71a80e932b..0000000000 --- a/cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl -w -T -use strict; -use warnings; - -BEGIN { - if ($ENV{PERL_CORE}) { - chdir 't'; - @INC = '../lib'; - } -} - -use Test::CanThread qw/AUTHOR_TESTING/; - -use Test::Builder; - -my $Test = Test::Builder->new; -$Test->exported_to('main'); -$Test->plan(tests => 6); - -for (1 .. 5) { - 'threads'->create( - sub { - $Test->ok(1, "Each of these should app the test number"); - } - )->join; -} - -$Test->is_num($Test->current_test(), 5, "Should be five"); diff --git a/cpan/Test-Simple/t/Behavior/todo.t b/cpan/Test-Simple/t/Behavior/todo.t deleted file mode 100644 index cb5a6e34b0..0000000000 --- a/cpan/Test-Simple/t/Behavior/todo.t +++ /dev/null @@ -1,43 +0,0 @@ -use strict; -use warnings; - -use Test::More; -use Test::Stream::Tester; - -my $events = intercept { - local $TODO = ""; - ok(0, "Should not be in todo 1"); - - local $TODO = 0; - ok(0, "Should not be in todo 2"); - - local $TODO = undef; - ok(0, "Should not be in todo 3"); - - local $TODO = "foo"; - ok(0, "Should be in todo"); -}; - -events_are( - $events, - check { - event ok => { in_todo => 0 }; - event ok => { in_todo => 0 }; - event ok => { in_todo => 0 }; - event ok => { in_todo => 1 }; - directive 'end'; - }, - "Verify TODO state" -); - -my $i = 0; -for my $e (@$events) { - next if $e->context->in_todo; - - my @tap = $e->to_tap(++$i); - my $ok_line = $tap[0]; - chomp(my $text = $ok_line->[1]); - is($text, "not ok $i - Should not be in todo $i", "No TODO directive $i"); -} - -done_testing; |