diff options
author | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2012-12-11 17:10:00 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2012-12-11 17:10:00 +0000 |
commit | 924e46179bb7dbab7bfc34d6234c97602f898b79 (patch) | |
tree | c721d745d5e3fe272d7101f341ebc6d680ba2736 /t/moose-ranges.t | |
parent | Build results of 0221a2c (on master) (diff) | |
download | data-multivalued-924e46179bb7dbab7bfc34d6234c97602f898b79.tar.gz data-multivalued-924e46179bb7dbab7bfc34d6234c97602f898b79.tar.bz2 data-multivalued-924e46179bb7dbab7bfc34d6234c97602f898b79.zip |
Build results of 2008730 (on master)
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(); |