From 5753ce0b56169a13e14034a26daefe8eafe8d614 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Mon, 19 Dec 2022 18:19:31 +0100 Subject: t/lib/GH_15109 - rename to t/lib/caller I want to use these modules in other tests, so changing the name makes sense. --- t/lib/GH_15109/Apack.pm | 4 ---- t/lib/GH_15109/Bpack.pm | 4 ---- t/lib/GH_15109/Cpack.pm | 11 ----------- t/lib/GH_15109/Foo.pm | 9 --------- t/lib/caller/Apack.pm | 4 ++++ t/lib/caller/Bpack.pm | 4 ++++ t/lib/caller/Cpack.pm | 11 +++++++++++ t/lib/caller/Foo.pm | 9 +++++++++ t/op/caller.t | 6 +++--- 9 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 t/lib/GH_15109/Apack.pm delete mode 100644 t/lib/GH_15109/Bpack.pm delete mode 100644 t/lib/GH_15109/Cpack.pm delete mode 100644 t/lib/GH_15109/Foo.pm create mode 100644 t/lib/caller/Apack.pm create mode 100644 t/lib/caller/Bpack.pm create mode 100644 t/lib/caller/Cpack.pm create mode 100644 t/lib/caller/Foo.pm (limited to 't') diff --git a/t/lib/GH_15109/Apack.pm b/t/lib/GH_15109/Apack.pm deleted file mode 100644 index fa52ec8b53..0000000000 --- a/t/lib/GH_15109/Apack.pm +++ /dev/null @@ -1,4 +0,0 @@ -# for use by caller.t for GH #15109 -package Apack; -use Bpack; -1; diff --git a/t/lib/GH_15109/Bpack.pm b/t/lib/GH_15109/Bpack.pm deleted file mode 100644 index f9421c813f..0000000000 --- a/t/lib/GH_15109/Bpack.pm +++ /dev/null @@ -1,4 +0,0 @@ -# for use by caller.t for GH #15109 -package Bpack; -use Cpack; -1; diff --git a/t/lib/GH_15109/Cpack.pm b/t/lib/GH_15109/Cpack.pm deleted file mode 100644 index 94c409b05c..0000000000 --- a/t/lib/GH_15109/Cpack.pm +++ /dev/null @@ -1,11 +0,0 @@ -# for use by caller.t for GH #15109 -package Cpack; - - -my $i = 0; - -while (my ($package, $file, $line) = caller($i++)) { - push @Cpack::callers, "$file:$line"; -} - -1; diff --git a/t/lib/GH_15109/Foo.pm b/t/lib/GH_15109/Foo.pm deleted file mode 100644 index 1af25470c6..0000000000 --- a/t/lib/GH_15109/Foo.pm +++ /dev/null @@ -1,9 +0,0 @@ -# for use by caller.t for GH #15109 - -package Foo; - -sub import { - use warnings; # restore default warnings - () = caller(1); # this used to cause valgrind errors -} -1; diff --git a/t/lib/caller/Apack.pm b/t/lib/caller/Apack.pm new file mode 100644 index 0000000000..597012102f --- /dev/null +++ b/t/lib/caller/Apack.pm @@ -0,0 +1,4 @@ +# for use by caller.t for GH #15109 and other tests +package Apack; +use Bpack; +1; diff --git a/t/lib/caller/Bpack.pm b/t/lib/caller/Bpack.pm new file mode 100644 index 0000000000..db0dca99ff --- /dev/null +++ b/t/lib/caller/Bpack.pm @@ -0,0 +1,4 @@ +# for use by caller.t for GH #15109 and other tests +package Bpack; +use Cpack; +1; diff --git a/t/lib/caller/Cpack.pm b/t/lib/caller/Cpack.pm new file mode 100644 index 0000000000..86c422f24e --- /dev/null +++ b/t/lib/caller/Cpack.pm @@ -0,0 +1,11 @@ +# for use by caller.t for GH #15109 and other tests +package Cpack; + + +my $i = 0; + +while (my ($package, $file, $line) = caller($i++)) { + push @Cpack::callers, "$file:$line"; +} + +1; diff --git a/t/lib/caller/Foo.pm b/t/lib/caller/Foo.pm new file mode 100644 index 0000000000..1af25470c6 --- /dev/null +++ b/t/lib/caller/Foo.pm @@ -0,0 +1,9 @@ +# for use by caller.t for GH #15109 + +package Foo; + +sub import { + use warnings; # restore default warnings + () = caller(1); # this used to cause valgrind errors +} +1; diff --git a/t/op/caller.t b/t/op/caller.t index 00bb984dcb..7ae7fabab1 100644 --- a/t/op/caller.t +++ b/t/op/caller.t @@ -339,14 +339,14 @@ do './op/caller.pl' or die $@; # See that callers within a nested series of 'use's gets the right # filenames. { - local @INC = 'lib/GH_15109/'; + local @INC = 'lib/caller/'; # Apack use's Bpack which use's Cpack which populates @Cpack::caller # with the file:N of all the callers eval 'use Apack; 1'; is($@, "", "GH #15109 - eval"); is (scalar(@Cpack::callers), 10, "GH #15109 - callers count"); - like($Cpack::callers[$_], qr{GH_15109/Bpack.pm:3}, "GH #15109 level $_") for 0..2; - like($Cpack::callers[$_], qr{GH_15109/Apack.pm:3}, "GH #15109 level $_") for 3..5; + like($Cpack::callers[$_], qr{caller/Bpack.pm:3}, "GH #15109 level $_") for 0..2; + like($Cpack::callers[$_], qr{caller/Apack.pm:3}, "GH #15109 level $_") for 3..5; like($Cpack::callers[$_], qr{\(eval \d+\):1}, "GH #15109 level $_") for 6..8; like($Cpack::callers[$_], qr{caller\.t}, "GH #15109 level $_") for 9; -- cgit v1.2.1