diff options
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/Test')
14 files changed, 64 insertions, 36 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder.pm index 6c3cceec99..4c14dc4817 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder.pm @@ -4,7 +4,7 @@ use 5.006; use strict; use warnings; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; BEGIN { if( $] < 5.008 ) { @@ -655,6 +655,8 @@ sub skip_all { die 'Label not found for "last T2_SUBTEST_WRAPPER"' if $begin && $ctx->hub->meta(__PACKAGE__, {})->{parent}; } + $reason = "$reason" if defined $reason; + $ctx->plan(0, SKIP => $reason); } @@ -765,7 +767,7 @@ sub _unoverload { require overload; } my $string_meth = overload::Method( $$thing, $type ) || return; - $$thing = $$thing->$string_meth(); + $$thing = $$thing->$string_meth(undef, 0); } sub _unoverload_str { @@ -1000,15 +1002,7 @@ END $self->_is_diag( $got, $type, $expect ); } elsif( $type =~ /^(ne|!=)$/ ) { - no warnings; - my $eq = ($got eq $expect || $got == $expect) - && ( - (defined($got) xor defined($expect)) - || (length($got) != length($expect)) - ); - use warnings; - - if ($eq) { + if (defined($got) xor defined($expect)) { $self->_cmp_diag( $got, $type, $expect ); } else { @@ -1072,6 +1066,13 @@ sub skip { my $ctx = $self->ctx; + $name = "$name"; + $why = "$why"; + + $name =~ s|#|\\#|g; # # in a name can confuse Test::Harness. + $name =~ s{\n}{\n# }sg; + $why =~ s{\n}{\n# }sg; + $ctx->hub->meta(__PACKAGE__, {})->{Test_Results}[ $ctx->hub->count ] = { 'ok' => 1, actual_ok => 1, @@ -1080,10 +1081,6 @@ sub skip { reason => $why, } unless $self->{no_log_results}; - $name =~ s|#|\\#|g; # # in a name can confuse Test::Harness. - $name =~ s{\n}{\n# }sg; - $why =~ s{\n}{\n# }sg; - my $tctx = $ctx->snapshot; $tctx->skip('', $why); diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Formatter.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Formatter.pm index e2acbc5831..4f3bee0dec 100755 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Formatter.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Formatter.pm @@ -2,7 +2,7 @@ package Test::Builder::Formatter; use strict; use warnings; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) } diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Module.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Module.pm index 40cf5d61f7..c5a24e6071 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Module.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Module.pm @@ -7,7 +7,7 @@ use Test::Builder; require Exporter; our @ISA = qw(Exporter); -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; =head1 NAME diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester.pm index 5bbe300fb3..a171b01eaf 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester.pm @@ -1,7 +1,7 @@ package Test::Builder::Tester; use strict; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; use Test::Builder; use Symbol; diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester/Color.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester/Color.pm index 1fb4a694c0..31a4c28a32 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester/Color.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/Tester/Color.pm @@ -1,7 +1,7 @@ package Test::Builder::Tester::Color; use strict; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; require Test::Builder::Tester; diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/TodoDiag.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/TodoDiag.pm index 6e04f5c53d..56d3fcbf25 100755 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/TodoDiag.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Builder/TodoDiag.pm @@ -2,7 +2,7 @@ package Test::Builder::TodoDiag; use strict; use warnings; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; BEGIN { require Test2::Event::Diag; our @ISA = qw(Test2::Event::Diag) } diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Harness.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Harness.pm index 7084d624e1..ea2302bd66 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Harness.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Harness.pm @@ -31,11 +31,11 @@ Test::Harness - Run Perl standard test scripts with statistics =head1 VERSION -Version 3.43 +Version 3.44 =cut -our $VERSION = '3.43'; +our $VERSION = '3.44'; # Backwards compatibility for exportable variable names. *verbose = *Verbose; @@ -550,7 +550,7 @@ C<file.tgz> =item C<< fPackage-With-Dashes >> Set the formatter_class of the harness being run. Since the C<HARNESS_OPTIONS> -is seperated by C<:>, we use C<-> instead. +is separated by C<:>, we use C<-> instead. =back diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm index 7212d25d6a..f1f9e37e8d 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm @@ -17,7 +17,7 @@ sub _carp { return warn @_, " at $file line $line\n"; } -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; use Test::Builder::Module; our @ISA = qw(Test::Builder::Module); @@ -394,8 +394,13 @@ different from some other value: isnt $obj, $clone, "clone() produces a different object"; -For those grammatical pedants out there, there's an C<isn't()> -function which is an alias of C<isnt()>. +Historically we supported an C<isn't()> function as an alias of +C<isnt()>, however in Perl 5.37.9 support for the use of aprostrophe as +a package separator was deprecated and by Perl 5.42.0 support for it +will have been removed completely. Accordingly use of C<isn't()> is also +deprecated, and will produce warnings when used unless 'deprecated' +warnings are specifically disabled in the scope where it is used. You +are strongly advised to migrate to using C<isnt()> instead. =cut @@ -411,8 +416,25 @@ sub isnt ($$;$) { return $tb->isnt_eq(@_); } -*isn't = \&isnt; -# ' to unconfuse syntax higlighters +# Historically it was possible to use apostrophes as a package +# separator. make this available as isn't() for perl's that support it. +# However in 5.37.9 the apostrophe as a package separator was +# deprecated, so warn users of isn't() that they should use isnt() +# instead. We assume that if they are calling isn::t() they are doing so +# via isn't() as we have no way to be sure that they aren't spelling it +# with a double colon. We only trigger the warning if deprecation +# warnings are enabled, so the user can silence the warning if they +# wish. +sub isn::t { + local ($@, $!, $?); + if (warnings::enabled("deprecated")) { + _carp + "Use of apostrophe as package separator was deprecated in Perl 5.37.9,\n", + "and will be removed in Perl 5.42.0. You should change code that uses\n", + "Test::More::isn't() to use Test::More::isnt() as a replacement"; + } + goto &isnt; +} =item B<like> @@ -1409,6 +1431,15 @@ and you'll know immediately when they're fixed. Once a todo test starts succeeding, simply move it outside the block. When the block is empty, delete it. +Note that, if you leave $TODO unset or undef, Test::More reports failures +as normal. This can be useful to mark the tests as expected to fail only +in certain conditions, e.g.: + + TODO: { + local $TODO = "$^O doesn't work yet. :(" if !_os_is_supported($^O); + + ... + } =item B<todo_skip> @@ -1761,8 +1792,8 @@ sub eq_set { Sometimes the Test::More interface isn't quite enough. Fortunately, Test::More is built on top of L<Test::Builder> which provides a single, unified backend for any test library to use. This means two test -libraries which both use <Test::Builder> B<can> be used together in the -same program>. +libraries which both use L<Test::Builder> B<can> be used together in the +same program. If you simply want to do a little tweaking of how the tests behave, you can access the underlying L<Test::Builder> object like so: diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Simple.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Simple.pm index b8a6c7ca40..a7649f4787 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Simple.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Simple.pm @@ -4,7 +4,7 @@ use 5.006; use strict; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; use Test::Builder::Module; our @ISA = qw(Test::Builder::Module); diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester.pm index 506734ea8b..9e91222ab7 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester.pm @@ -18,7 +18,7 @@ require Exporter; use vars qw( @ISA @EXPORT ); -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; @EXPORT = qw( run_tests check_tests check_test cmp_results show_space ); @ISA = qw( Exporter ); diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Capture.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Capture.pm index 71324b03d1..7c7e8545f8 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Capture.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Capture.pm @@ -2,7 +2,7 @@ use strict; package Test::Tester::Capture; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; use Test::Builder; diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/CaptureRunner.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/CaptureRunner.pm index ffd6e99f2e..574de86cda 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/CaptureRunner.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/CaptureRunner.pm @@ -3,7 +3,7 @@ use strict; package Test::Tester::CaptureRunner; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; use Test::Tester::Capture; diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Delegate.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Delegate.pm index 826c21e71e..1c8d873cdd 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Delegate.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/Tester/Delegate.pm @@ -3,7 +3,7 @@ use warnings; package Test::Tester::Delegate; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; use Scalar::Util(); diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/use/ok.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/use/ok.pm index 1e2f0df2c1..757e1684aa 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/use/ok.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/use/ok.pm @@ -1,7 +1,7 @@ package Test::use::ok; use 5.005; -our $VERSION = '1.302183'; +our $VERSION = '1.302194'; __END__ |