summaryrefslogtreecommitdiff
path: root/lib/NEXT
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-14 18:29:19 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-14 18:29:19 +0000
commitbf5734d48cfc03fbca4e85c5e0afdb1758ace04f (patch)
tree63b9848aced127dfb9739620856206e5c53171cb /lib/NEXT
parentaebbc030f6d3425d30af1549baaeea8adc77a4a8 (diff)
downloadperl-bf5734d48cfc03fbca4e85c5e0afdb1758ace04f.tar.gz
Upgrade to NEXT 0.60.
p4raw-id: //depot/perl@20712
Diffstat (limited to 'lib/NEXT')
-rw-r--r--lib/NEXT/Changes14
-rw-r--r--lib/NEXT/README8
-rw-r--r--lib/NEXT/t/actual.t29
-rw-r--r--lib/NEXT/t/actuns.t22
-rw-r--r--lib/NEXT/t/unseen.t29
5 files changed, 68 insertions, 34 deletions
diff --git a/lib/NEXT/Changes b/lib/NEXT/Changes
index 9bd1ebf287..fc34098778 100644
--- a/lib/NEXT/Changes
+++ b/lib/NEXT/Changes
@@ -53,3 +53,17 @@ Revision history for Perl extension NEXT.pm.
0.52 Wed Jul 30 21:06:59 2003
+ - Refixed NEXT::UNSEEN bug under diamond inheritance
+
+
+0.53 Tue Aug 12 10:53:25 2003
+
+ - Re-re-fixed NEXT::UNSEEN bug under diamond inheritance
+
+
+0.60 Wed Aug 13 03:55:33 2003
+
+ - Re-re-re-fixed NEXT::UNSEEN bug under diamond inheritance
+ (Note to self: don't code whilst on vacation!)
+
+ - Implemented and documented EVERY functionality
diff --git a/lib/NEXT/README b/lib/NEXT/README
index 42fe91db57..a60aae0bc3 100644
--- a/lib/NEXT/README
+++ b/lib/NEXT/README
@@ -1,5 +1,5 @@
==============================================================================
- Release of version 0.52 of NEXT
+ Release of version 0.60 of NEXT
==============================================================================
@@ -50,9 +50,13 @@ COPYRIGHT
==============================================================================
-CHANGES IN VERSION 0.52
+CHANGES IN VERSION 0.60
+ - Re-re-re-fixed NEXT::UNSEEN bug under diamond inheritance
+ (Note to self: don't code whilst on vacation!)
+
+ - Implemented and documented EVERY functionality
==============================================================================
diff --git a/lib/NEXT/t/actual.t b/lib/NEXT/t/actual.t
index e45184052b..dbd040da26 100644
--- a/lib/NEXT/t/actual.t
+++ b/lib/NEXT/t/actual.t
@@ -1,3 +1,5 @@
+use Test::More 'no_plan';
+
BEGIN {
if ($ENV{PERL_CORE}) {
chdir('t') if -d 't';
@@ -5,27 +7,31 @@ BEGIN {
}
}
-BEGIN { print "1..9\n"; }
-use NEXT;
-
-my $count=1;
+BEGIN { use_ok('NEXT') };
+my $order = 0;
package A;
@ISA = qw/B C D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+sub test { ++$order; ::ok($order==1,"test A"); $_[0]->NEXT::ACTUAL::test;}
package B;
-@ISA = qw/C D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+@ISA = qw/D C/;
+sub test { ++$order; ::ok($order==2,"test B"); $_[0]->NEXT::ACTUAL::test;}
package C;
@ISA = qw/D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+sub test {
+ ++$order; ::ok($order==4||$order==6,"test C");
+ $_[0]->NEXT::ACTUAL::test;
+}
package D;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::test;}
+sub test {
+ ++$order; ::ok($order==3||$order==5||$order==7||$order==8,"test D");
+ $_[0]->NEXT::ACTUAL::test;
+}
package main;
@@ -33,5 +39,6 @@ my $foo = {};
bless($foo,"A");
-eval { $foo->test } and print "not ";
-print "ok 9\n";
+eval{ $foo->test }
+ ? fail("Didn't die on missing ancestor")
+ : pass("Correctly dies after full traversal");
diff --git a/lib/NEXT/t/actuns.t b/lib/NEXT/t/actuns.t
index aca30c7d26..a99fbe5256 100644
--- a/lib/NEXT/t/actuns.t
+++ b/lib/NEXT/t/actuns.t
@@ -1,3 +1,5 @@
+use Test::More 'no_plan';
+
BEGIN {
if ($ENV{PERL_CORE}) {
chdir('t') if -d 't';
@@ -5,27 +7,25 @@ BEGIN {
}
}
-BEGIN { print "1..6\n"; }
-use NEXT;
-
-my $count=1;
+BEGIN { use_ok('NEXT') };
+my $order = 0;
package A;
@ISA = qw/B C D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::ACTUAL::test;}
+sub test { ::ok(++$order==1,"test A"); $_[0]->NEXT::UNSEEN::ACTUAL::test;}
package B;
-@ISA = qw/C D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::UNSEEN::test;}
+@ISA = qw/D C/;
+sub test { ::ok(++$order==2,"test B"); $_[0]->NEXT::ACTUAL::UNSEEN::test;}
package C;
@ISA = qw/D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::ACTUAL::test;}
+sub test { ::ok(++$order==4,"test C"); $_[0]->NEXT::UNSEEN::ACTUAL::test;}
package D;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::ACTUAL::UNSEEN::test;}
+sub test { ::ok(++$order==3,"test D"); $_[0]->NEXT::ACTUAL::UNSEEN::test;}
package main;
@@ -33,4 +33,6 @@ my $foo = {};
bless($foo,"A");
-eval { $foo->test } and print "not ";
+eval{ $foo->test }
+ ? fail("Didn't die on missing ancestor")
+ : pass("Correctly dies after C");
diff --git a/lib/NEXT/t/unseen.t b/lib/NEXT/t/unseen.t
index ddaab1851a..1304ad67b5 100644
--- a/lib/NEXT/t/unseen.t
+++ b/lib/NEXT/t/unseen.t
@@ -1,3 +1,5 @@
+use Test::More 'no_plan';
+
BEGIN {
if ($ENV{PERL_CORE}) {
chdir('t') if -d 't';
@@ -5,27 +7,25 @@ BEGIN {
}
}
-BEGIN { print "1..10\n"; }
-use NEXT;
-
-my $count=1;
+BEGIN { use_ok('NEXT') };
+my $order = 0;
package A;
@ISA = qw/B C D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+sub test { ::ok(++$order==1,"test A"); $_[0]->NEXT::UNSEEN::test; 1}
package B;
-@ISA = qw/C D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+@ISA = qw/D C/;
+sub test { ::ok(++$order==2,"test B"); $_[0]->NEXT::UNSEEN::test; 1}
package C;
@ISA = qw/D/;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+sub test { ::ok(++$order==4,"test C"); $_[0]->NEXT::UNSEEN::test; 1}
package D;
-sub test { print "ok ", $count++, "\n"; $_[0]->NEXT::UNSEEN::test;}
+sub test { ::ok(++$order==3,"test D"); $_[0]->NEXT::UNSEEN::test; 1}
package main;
@@ -33,10 +33,17 @@ my $foo = {};
bless($foo,"A");
-$foo->test;
+eval{ $foo->test }
+ ? pass("Correctly survives after C")
+ : fail("Shouldn't die on missing ancestor");
package Diamond::Base;
-sub test { print "ok ", $count++, "\n"; shift->NEXT::UNSEEN::test; }
+my $seen;
+sub test {
+ $seen++ ? ::fail("Can't visit inherited test twice")
+ : ::pass("First diamond is okay");
+ shift->NEXT::UNSEEN::test;
+}
package Diamond::Left; @ISA = qw[Diamond::Base];
package Diamond::Right; @ISA = qw[Diamond::Base];