summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
committerNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
commit12679ab7d3c2a210f4123163671b532b8b55d5f9 (patch)
tree0060d13467186ad977f4e73488ee20dd6c0017ab /systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm
parent62170822e034fdd3f81de7274835d0d3b0467100 (diff)
CTAN sync 202403150306
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/Test/More.pm45
1 files changed, 38 insertions, 7 deletions
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: