diff options
author | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2012-12-11 17:08:10 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2012-12-11 17:10:33 +0000 |
commit | f3843b86e5173a11c084287c00edf0fa1f9fb817 (patch) | |
tree | 064fccbf68d24fe88e2c844b8a7a4f9cd9114946 /t/moose-ranges.t | |
parent | fake bump (diff) | |
download | data-multivalued-0.0.7_1-dzilla.tar.gz data-multivalued-0.0.7_1-dzilla.tar.bz2 data-multivalued-0.0.7_1-dzilla.zip |
add all_tags etcv0.0.7_1-dzilla
Diffstat (limited to 't/moose-ranges.t')
-rw-r--r-- | t/moose-ranges.t | 27 |
1 files changed, 27 insertions, 0 deletions
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(); |