From: Bram Date: Fri, 24 Jul 2009 10:39:50 +0000 (+0200) Subject: Add a test for mro::method_changed_in() and mro::invalidate_all_method_caches() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4283ec8b813da1587716995b70c48847a3818b62;p=p5sagit%2Fp5-mst-13.2.git Add a test for mro::method_changed_in() and mro::invalidate_all_method_caches() --- diff --git a/t/mro/basic.t b/t/mro/basic.t index 8568517..a4d3015 100644 --- a/t/mro/basic.t +++ b/t/mro/basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -require q(./test.pl); plan(tests => 42); +require q(./test.pl); plan(tests => 44); require mro; @@ -248,3 +248,20 @@ is(eval { MRO_N->testfunc() }, 123); *{P1::bark} = sub { "[bark]" }; is(scalar eval { $foo->bark }, "[bark]", "can bark now"); } + +{ + # test mro::method_changed_in + my $count = mro::get_pkg_gen("MRO_A"); + mro::method_changed_in("MRO_A"); + my $count_new = mro::get_pkg_gen("MRO_A"); + + is($count_new, $count + 1); +} + +{ + # test if we can call mro::invalidate_all_method_caches; + eval { + mro::invalidate_all_method_caches(); + }; + is($@, ""); +}