From: Dave Rolsky Date: Fri, 29 Oct 2010 14:13:36 +0000 (-0500) Subject: Add tests for keys & values delegations X-Git-Tag: 1.18~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1399eab071682f06a77e347603184e9320db137b;p=gitmo%2FMoose.git Add tests for keys & values delegations --- diff --git a/t/070_native_traits/050_trait_hash.t b/t/070_native_traits/050_trait_hash.t index b64137b..84fd2d3 100644 --- a/t/070_native_traits/050_trait_hash.t +++ b/t/070_native_traits/050_trait_hash.t @@ -25,6 +25,7 @@ use Test::Moose; get_option => 'get', has_no_options => 'is_empty', keys => 'keys', + values => 'values', key_value => 'kv', set_option => 'set', ); @@ -188,6 +189,18 @@ sub run_tests { 'set returns newly set values in order of keys provided' ); + is_deeply( + [ sort $obj->keys ], + [ 'oink', 'quantity', 'xxy' ], + 'keys returns expected keys' + ); + + is_deeply( + [ sort $obj->values ], + [ 4, 'blah', 'flop' ], + 'values returns expected values' + ); + my @key_value = sort { $a->[0] cmp $b->[0] } $obj->key_value; is_deeply( \@key_value,