This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
To-do tests for isarev (more to come)
authorFather Chrysostomos <sprout@cpan.org>
Sat, 30 Oct 2010 12:46:47 +0000 (05:46 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 30 Oct 2010 13:52:38 +0000 (06:52 -0700)
MANIFEST
t/mro/isarev.t [new file with mode: 0644]

index ec0b60c..8c87077 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -4550,6 +4550,7 @@ t/mro/dbic_dfs.t          mro tests
 t/mro/inconsistent_c3.t                mro tests
 t/mro/isa_c3.t                 test for optimisatised mro_get_linear_isa_c3
 t/mro/isa_dfs.t                        test for optimisatised mro_get_linear_isa_dfs
+t/mro/isarev.t                 PL_isarev/mro::get_isarev tests
 t/mro/method_caching.t         mro tests
 t/mro/next_edgecases.t         mro tests
 t/mro/next_goto.t              mro tests
diff --git a/t/mro/isarev.t b/t/mro/isarev.t
new file mode 100644 (file)
index 0000000..f93c046
--- /dev/null
@@ -0,0 +1,35 @@
+#!./perl
+
+BEGIN {
+    unless (-d 'blib') {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
+    require q(./test.pl);
+}
+
+use strict;
+use warnings;
+plan(tests => 3);
+
+use mro;
+
+sub i {
+ @_ = @_;
+ $_[0] = "@{mro::get_isarev $_[0]}";
+ $_[1] = "@{$_[1]}";
+ goto &is;
+}
+
+$::TODO = "[perl #75176] isarev leeks (and onions)";
+
+@Huskey::ISA = "Dog";
+@Dog::ISA = "Canid";
+@Some::Brand::Name::ISA = "Dog::Bone";
+@Dog::Bone::ISA = "Treat";
+@MyCollar::ISA = "Dog::Collar::Leather";
+@Dog::Collar::Leather::ISA = "Collar";
+delete $::{"Dog::"};
+i Canid=>[], "deleting a stash elem removes isarev entries";
+i Treat=>[], "deleting a nested stash elem removes isarev entries";
+i Collar=>[], "deleting a doubly nested stash elem removes isarev entries";