diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2016-12-03 06:47:12 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2016-12-03 06:47:12 +0000 |
commit | fa951d2c91f349f100412a541b9fa2f6122af080 (patch) | |
tree | a005d7a046e152de15049e2600aca59898847a33 /cpan/Test-Simple/lib/Test/Builder.pm | |
parent | 12389a222086acf35b117d758b1c459ffd88aab4 (diff) | |
download | perl-fa951d2c91f349f100412a541b9fa2f6122af080.tar.gz |
Update Test-Simple to CPAN version 1.302067
[DELTA]
1.302067 2016-11-23 07:37:56-08:00 America/Los_Angeles
- Fix context test for recent blead.
1.302066 2016-11-08 07:58:39-08:00 America/Los_Angeles (TRIAL RELEASE)
- Handle cases where SysV IPC can be available but not enabled
- Import 'context' into Test2::IPC, it is used by 'cull'
- Propogate warnings settings to use_ok (#736)
1.302065 2016-10-30 11:54:37-07:00 America/Los_Angeles (TRIAL RELEASE)
- Set the TEST_ACTIVE env var to true
- Set the TEST2_ACTIVE env var to true
- Fix the oldest bug still in the bug list (#6)
This fixes cmp_ok output is some confusing cases
- Update travis config
- Add missing author deps
- Fix handling of negative pid's on windows
- Add can() to Test::Tester::Delegate (despite deprecation)
- Fix some minor test issues
1.302064 2016-10-24 21:03:24-07:00 America/Los_Angeles (TRIAL RELEASE)
- Repo management improvements
- Better handling of info vs diag in ->send_event
- Fix test that used 'parent'
- Better handling of non-bumping failures (#728)
1.302063 2016-10-23 21:31:20-07:00 America/Los_Angeles (TRIAL RELEASE)
- Fix double release when 'throw' is used in context_do()
Diffstat (limited to 'cpan/Test-Simple/lib/Test/Builder.pm')
-rw-r--r-- | cpan/Test-Simple/lib/Test/Builder.pm | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm index a10c19fdb7..b838f1db27 100644 --- a/cpan/Test-Simple/lib/Test/Builder.pm +++ b/cpan/Test-Simple/lib/Test/Builder.pm @@ -4,7 +4,7 @@ use 5.006; use strict; use warnings; -our $VERSION = '1.302062'; +our $VERSION = '1.302067'; BEGIN { if( $] < 5.008 ) { @@ -238,6 +238,7 @@ sub finalize { my $plan = $chub->plan || 0; my $count = $chub->count; my $failed = $chub->failed; + my $passed = $chub->is_passing; my $num_extra = $plan =~ m/\D/ ? 0 : $count - $plan; if ($count && $num_extra != 0) { @@ -257,6 +258,12 @@ Looks like you failed $failed test$s of $count$qualifier. FAIL } + if (!$passed && !$failed && $count && !$num_extra) { + $st_ctx->diag(<<"FAIL"); +All assertions inside the subtest passed, but errors were encountered. +FAIL + } + $st_ctx->release; unless ($chub->bailed_out) { @@ -919,7 +926,20 @@ END $self->_is_diag( $got, $type, $expect ); } elsif( $type =~ /^(ne|!=)$/ ) { - $self->_isnt_diag( $got, $type ); + no warnings; + my $eq = ($got eq $expect || $got == $expect) + && ( + (defined($got) xor defined($expect)) + || (length($got) != length($expect)) + ); + use warnings; + + if ($eq) { + $self->_cmp_diag( $got, $type, $expect ); + } + else { + $self->_isnt_diag( $got, $type ); + } } else { $self->_cmp_diag( $got, $type, $expect ); @@ -1550,6 +1570,7 @@ sub _ending { my $plan = $hub->plan; my $count = $hub->count; my $failed = $hub->failed; + my $passed = $hub->is_passing; return unless $plan || $count || $failed; # Ran tests but never declared a plan or hit done_testing @@ -1622,6 +1643,12 @@ Looks like you failed $failed test$s of $count$qualifier. FAIL } + if (!$passed && !$failed && $count && !$num_extra) { + $ctx->diag(<<"FAIL"); +All assertions passed, but errors were encountered. +FAIL + } + my $exit_code = 0; if ($failed) { $exit_code = $failed <= 254 ? $failed : 254; @@ -1629,6 +1656,9 @@ FAIL elsif ($num_extra != 0) { $exit_code = 255; } + elsif (!$passed) { + $exit_code = 255; + } $$new ||= $exit_code; return; |