From: Peter Rabbitson Date: Mon, 29 Oct 2012 07:37:47 +0000 (+0100) Subject: Add an extra sub-naming test X-Git-Tag: v0.10007~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0d633b8208edc003d3acb32f59cf1b12a4992720;p=p5sagit%2FClass-Accessor-Grouped.git Add an extra sub-naming test --- diff --git a/t/basic.t b/t/basic.t index b606605..fa929fc 100644 --- a/t/basic.t +++ b/t/basic.t @@ -1,9 +1,19 @@ use strict; use warnings; -BEGIN { - use lib 't/lib'; - use Test::More tests => 1; +use Test::More; +use B qw/svref_2object/; - use_ok('Class::Accessor::Grouped'); -}; +use_ok('Class::Accessor::Grouped'); + +# ensure core accessor types are properly named +# +for (qw/simple inherited component_class/) { + for my $meth ("get_$_", "set_$_") { + my $cv = svref_2object( Class::Accessor::Grouped->can($meth) ); + is($cv->GV->NAME, $meth, "$meth accessor is named"); + is($cv->GV->STASH->NAME, 'Class::Accessor::Grouped', "$meth class correct"); + } +} + +done_testing;