summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2021-03-01 23:14:32 +0000
committerafresh1 <afresh1@openbsd.org>2021-03-01 23:14:32 +0000
commitde8cc8edbc71bd3e3bc7fbffa27ba0e564c37d8b (patch)
tree5e91ea1711126841ef19ee1ee17705e29dc6baf0 /gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API
parentUpdate the MSI addresses for the Armada 8040. This chunk will only be (diff)
downloadwireguard-openbsd-de8cc8edbc71bd3e3bc7fbffa27ba0e564c37d8b.tar.xz
wireguard-openbsd-de8cc8edbc71bd3e3bc7fbffa27ba0e564c37d8b.zip
Import perl-5.32.1
OK sthen@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API')
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Breakage.t16
-rw-r--r--gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Context.t26
2 files changed, 35 insertions, 7 deletions
diff --git a/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Breakage.t b/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Breakage.t
index e2932469f38..26d01b84601 100644
--- a/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Breakage.t
+++ b/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Breakage.t
@@ -33,12 +33,12 @@ for my $meth (qw/upgrade_suggested upgrade_required known_broken/) {
{
local %INC = (
%INC,
- 'T2Test/UG1.pm' => 1,
- 'T2Test/UG2.pm' => 1,
- 'T2Test/UR1.pm' => 1,
- 'T2Test/UR2.pm' => 1,
- 'T2Test/KB1.pm' => 1,
- 'T2Test/KB2.pm' => 1,
+ 'T2Test/UG1.pm' => 'T2Test/UG1.pm',
+ 'T2Test/UG2.pm' => 'T2Test/UG2.pm',
+ 'T2Test/UR1.pm' => 'T2Test/UR1.pm',
+ 'T2Test/UR2.pm' => 'T2Test/UR2.pm',
+ 'T2Test/KB1.pm' => 'T2Test/KB1.pm',
+ 'T2Test/KB2.pm' => 'T2Test/KB2.pm',
);
local $T2Test::UG1::VERSION = '0.9';
local $T2Test::UG2::VERSION = '0.9';
@@ -49,14 +49,16 @@ for my $meth (qw/upgrade_suggested upgrade_required known_broken/) {
my @report = $CLASS->report;
+ $_ =~ s{\S+/Breakage\.pm}{Breakage.pm}g for @report;
+
is_deeply(
[sort @report],
[
sort
- " * Module 'T2Test::UG1' is outdated, we recommed updating above 1.0.",
" * Module 'T2Test::UR1' is outdated and known to be broken, please update to 1.0 or higher.",
" * Module 'T2Test::KB1' is known to be broken in version 1.0 and below, newer versions have not been tested. You have: 0.9",
" * Module 'T2Test::KB2' is known to be broken in version 0.5 and below, newer versions have not been tested. You have: 0.9",
+ " * Module 'T2Test::UG1' is outdated, we recommed updating above 1.0. error was: 'T2Test::UG1 version 1.0 required--this is only version 0.9 at Breakage.pm line 75.'; INC is T2Test/UG1.pm",
],
"Got expected report items"
);
diff --git a/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Context.t b/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Context.t
index 207f3d0a070..b17dd20695f 100644
--- a/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Context.t
+++ b/gnu/usr.bin/perl/cpan/Test-Simple/t/Test2/modules/API/Context.t
@@ -477,4 +477,30 @@ sub {
}->();
+sub ctx_destroy_test {
+ my (undef, undef, $line1) = caller();
+ my (@warn, $line2);
+ local $SIG{__WARN__} = sub { push @warn => $_[0] };
+
+ { my $ctx = context(); $ctx = undef } $line2 = __LINE__;
+
+ use Data::Dumper;
+# print Dumper(@warn);
+
+ like($warn[0], qr/context appears to have been destroyed without first calling release/, "Is normal context warning");
+ like($warn[0], qr{\QContext destroyed at ${ \__FILE__ } line $line2\E}, "Reported context destruction trace");
+
+ my $created = <<" EOT";
+Here are the context creation details, just in case a tool forgot to call
+release():
+ File: ${ \__FILE__ }
+ Line: $line1
+ Tool: main::ctx_destroy_test
+ EOT
+
+ like($warn[0], qr{\Q$created\E}, "Reported context creation details");
+};
+
+ctx_destroy_test();
+
done_testing;