summaryrefslogtreecommitdiff
path: root/lib/NEXT
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-11-20 02:53:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-20 02:53:32 +0000
commit13021a801cfcd7c449594b5981d5c50bebea8e98 (patch)
tree96b50b91718c1f7ffe6144b76234b77b06321b48 /lib/NEXT
parent58d672b081c291e2ccf27550e38b9358ae93f71d (diff)
downloadperl-13021a801cfcd7c449594b5981d5c50bebea8e98.tar.gz
Upgrade to NEXT 0.50.
p4raw-id: //depot/perl@13117
Diffstat (limited to 'lib/NEXT')
-rw-r--r--lib/NEXT/Changes17
-rw-r--r--lib/NEXT/README25
-rw-r--r--lib/NEXT/t/actual.t37
-rw-r--r--lib/NEXT/t/actuns.t37
-rw-r--r--lib/NEXT/t/next.t (renamed from lib/NEXT/test.pl)7
-rw-r--r--lib/NEXT/t/unseen.t36
6 files changed, 150 insertions, 9 deletions
diff --git a/lib/NEXT/Changes b/lib/NEXT/Changes
index bb5e27a7b8..f6f7bff1b2 100644
--- a/lib/NEXT/Changes
+++ b/lib/NEXT/Changes
@@ -20,3 +20,20 @@ Revision history for Perl extension NEXT.pm.
- Fixed setting of $AUTOLOAD in NEXT'd AUTOLOADS (thanks Leonid)
- Changed licence for inclusion in core distribution
+
+
+0.50 Fri Nov 16 11:20:40 2001
+
+ - Added a $VERSION (oops!)
+
+ - Fixed handling of diamond patterns (thanks Paul)
+
+ - Added NEXT::ACTUAL to require existence of next method (thanks Paul)
+
+ - Added NEXT::UNSEEN to avoid calling multiply inherited
+ methods twice (thanks Paul)
+
+ - Re-fixed setting of $AUTOLOAD in NEXT'd AUTOLOADS to be
+ consistent with more useful SUPER:: behaviour
+
+ - Corified tests
diff --git a/lib/NEXT/README b/lib/NEXT/README
index 7202d00fde..ad750bcdb4 100644
--- a/lib/NEXT/README
+++ b/lib/NEXT/README
@@ -1,5 +1,5 @@
==============================================================================
- Release of version 0.02 of NEXT
+ Release of version 0.50 of NEXT
==============================================================================
@@ -31,10 +31,9 @@ DESCRIPTION
redispatch that call, in the hope that some other C<AUTOLOAD>
(above it, or to its left) might do better.
- Note that it is a fatal error for any method (including C<AUTOLOAD>)
- to attempt to redispatch any method except itself. For example:
-
- sub D::oops { $_[0]->NEXT::other_method() } # BANG!
+ The module also allows you to specify that multiply inherited
+ methods should only be redispatched once, and what should
+ happen if no redispatch is possible.
AUTHOR
@@ -51,12 +50,22 @@ COPYRIGHT
==============================================================================
-CHANGES IN VERSION 0.02
+CHANGES IN VERSION 0.50
+
+
+ - Added a $VERSION (oops!)
+
+ - Fixed handling of diamond patterns (thanks Paul)
+
+ - Added NEXT::ACTUAL to require existence of next method (thanks Paul)
+ - Added NEXT::UNSEEN to avoid calling multiply inherited
+ methods twice (thanks Paul)
- - Fixed setting of $AUTOLOAD in NEXT'd AUTOLOADS (thanks Leonid)
+ - Re-fixed setting of $AUTOLOAD in NEXT'd AUTOLOADS to be
+ consistent with more useful SUPER:: behaviour
- - Changed licence for inclusion in core distribution
+ - Corified tests
==============================================================================
diff --git a/lib/NEXT/t/actual.t b/lib/NEXT/t/actual.t
new file mode 100644
index 0000000000..e45184052b
--- /dev/null
+++ b/lib/NEXT/t/actual.t
@@ -0,0 +1,37 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir('t') if -d 't';
+ @INC = qw(../lib);
+ }
+}
+
+BEGIN { print "1..9\n"; }
+use NEXT;
+
+my $count=1;
+
+package A;
+@ISA = qw/B C D/;
+
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+
+package B;
+@ISA = qw/C D/;
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+
+package C;
+@ISA = qw/D/;
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+
+package D;
+
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+
+package main;
+
+my $foo = {};
+
+bless($foo,"A");
+
+eval { $foo->test } and print "not ";
+print "ok 9\n";
diff --git a/lib/NEXT/t/actuns.t b/lib/NEXT/t/actuns.t
new file mode 100644
index 0000000000..3795681bc2
--- /dev/null
+++ b/lib/NEXT/t/actuns.t
@@ -0,0 +1,37 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir('t') if -d 't';
+ @INC = qw(../lib);
+ }
+}
+
+BEGIN { print "1..5\n"; }
+use NEXT;
+
+my $count=1;
+
+package A;
+@ISA = qw/B C D/;
+
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::ACTUAL::test;}
+
+package B;
+@ISA = qw/C D/;
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::UNSEEN::test;}
+
+package C;
+@ISA = qw/D/;
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::ACTUAL::test;}
+
+package D;
+
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::UNSEEN::test;}
+
+package main;
+
+my $foo = {};
+
+bless($foo,"A");
+
+eval { $foo->test } and print "not ";
+print "ok 5\n";
diff --git a/lib/NEXT/test.pl b/lib/NEXT/t/next.t
index 0ba0b663bf..8cc493f318 100644
--- a/lib/NEXT/test.pl
+++ b/lib/NEXT/t/next.t
@@ -1,4 +1,9 @@
-#! /usr/local/bin/perl -w
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir('t') if -d 't';
+ @INC = qw(../lib);
+ }
+}
BEGIN { print "1..25\n"; }
diff --git a/lib/NEXT/t/unseen.t b/lib/NEXT/t/unseen.t
new file mode 100644
index 0000000000..af8d1f7612
--- /dev/null
+++ b/lib/NEXT/t/unseen.t
@@ -0,0 +1,36 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir('t') if -d 't';
+ @INC = qw(../lib);
+ }
+}
+
+BEGIN { print "1..4\n"; }
+use NEXT;
+
+my $count=1;
+
+package A;
+@ISA = qw/B C D/;
+
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+
+package B;
+@ISA = qw/C D/;
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+
+package C;
+@ISA = qw/D/;
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+
+package D;
+
+sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+
+package main;
+
+my $foo = {};
+
+bless($foo,"A");
+
+$foo->test;