From f3843b86e5173a11c084287c00edf0fa1f9fb817 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Tue, 11 Dec 2012 17:08:10 +0000 Subject: add all_tags etc --- t/moose-ranges.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 't/moose-ranges.t') diff --git a/t/moose-ranges.t b/t/moose-ranges.t index 404e649..35ff83d 100644 --- a/t/moose-ranges.t +++ b/t/moose-ranges.t @@ -34,6 +34,15 @@ subtest 'default' => sub { ok($obj->has_stuff,'has stuff'); is($obj->stuff,3,'default'); + + cmp_deeply( + [$obj->meta->get_attribute('stuff')->all_ranges($obj)], + [[undef,undef]], + 'stuff all_ranges'); + cmp_deeply( + [$obj->meta->get_attribute('other')->all_ranges($obj)], + [], + 'other all_ranges'); }; subtest 'constructor param' => sub { @@ -44,6 +53,15 @@ subtest 'constructor param' => sub { is($obj->stuff,12,'param'); is($obj->other,'bar','param'); + + cmp_deeply( + [$obj->meta->get_attribute('stuff')->all_ranges($obj)], + [[undef,undef]], + 'stuff all_ranges'); + cmp_deeply( + [$obj->meta->get_attribute('other')->all_ranges($obj)], + [[undef,undef]], + 'other all_ranges'); }; subtest 'with ranges' => sub { @@ -62,6 +80,15 @@ subtest 'with ranges' => sub { is($obj->stuff,3,'default'); is($obj->stuff_multi($opts),7,'stuff ranged'); is($obj->other_multi($opts),'foo','other ranged'); + + cmp_deeply( + [$obj->meta->get_attribute('stuff')->all_ranges($obj)], + [[undef,10],[10,20],[20,undef]], + 'stuff all_ranges'); + cmp_deeply( + [$obj->meta->get_attribute('other')->all_ranges($obj)], + [[10,20]], + 'other all_ranges'); }; done_testing(); -- cgit v1.2.3