From: Brandon L Black Date: Tue, 15 May 2007 16:10:12 +0000 (+0000) Subject: two simple test fixes for 5.9.5 X-Git-Tag: 0_38~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21af8dc9648beecd5c0204c4465f029744ae5735;p=gitmo%2FClass-MOP.git two simple test fixes for 5.9.5 --- diff --git a/t/002_class_precedence_list.t b/t/002_class_precedence_list.t index c9b84d3..2a749ae 100644 --- a/t/002_class_precedence_list.t +++ b/t/002_class_precedence_list.t @@ -46,19 +46,24 @@ is_deeply( =cut -{ - package My::2::A; - use metaclass; - our @ISA = ('My::2::C'); +# 5.9.5+ dies at the moment of +# recursive @ISA definition, not later when +# you try to use the @ISAs. +eval { + { + package My::2::A; + use metaclass; + our @ISA = ('My::2::C'); - package My::2::B; - our @ISA = ('My::2::A'); + package My::2::B; + our @ISA = ('My::2::A'); - package My::2::C; - our @ISA = ('My::2::B'); -} + package My::2::C; + our @ISA = ('My::2::B'); + } -eval { My::2::B->meta->class_precedence_list }; + My::2::B->meta->class_precedence_list +}; ok($@, '... recursive inheritance breaks correctly :)'); =pod diff --git a/t/200_Class_C3_compatibility.t b/t/200_Class_C3_compatibility.t index 7eba482..bf091d4 100644 --- a/t/200_Class_C3_compatibility.t +++ b/t/200_Class_C3_compatibility.t @@ -56,8 +56,12 @@ is_deeply( ok(Diamond_A->meta->has_method('hello'), '... A has a method hello'); ok(!Diamond_B->meta->has_method('hello'), '... B does not have a method hello'); -ok(defined &Diamond_B::hello, '... B does have an alias to the method hello'); ok(Diamond_C->meta->has_method('hello'), '... C has a method hello'); ok(!Diamond_D->meta->has_method('hello'), '... D does not have a method hello'); -ok(defined &Diamond_D::hello, '... D does have an alias to the method hello'); + +SKIP: { + skip "C3 does not make aliases on 5.9.5+", 2 if $] > 5.009_004; + ok(defined &Diamond_B::hello, '... B does have an alias to the method hello'); + ok(defined &Diamond_D::hello, '... D does have an alias to the method hello'); +}