From: gfx Date: Fri, 4 Sep 2009 07:10:21 +0000 (+0900) Subject: Fix a test to remove the dependency on the order of keys/values. Sort the values... X-Git-Tag: 0.89_02~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=caa615b3d0911996ff9d178d1d32a590a32a800d;p=gitmo%2FMoose.git Fix a test to remove the dependency on the order of keys/values. Sort the values before compare them. --- diff --git a/t/070_native_traits/203_trait_hash.t b/t/070_native_traits/203_trait_hash.t index fe2e649..3af65b5 100644 --- a/t/070_native_traits/203_trait_hash.t +++ b/t/070_native_traits/203_trait_hash.t @@ -166,12 +166,12 @@ is( $options->type_constraint->type_parameter, 'Str', '... got the right container type' ); $stuff->set_option( oink => "blah", xxy => "flop" ); -my @key_value = $stuff->key_value; +my @key_value = sort{ $a->[0] cmp $b->[0] } $stuff->key_value; is_deeply( \@key_value, - [ [ 'xxy', 'flop' ], [ 'quantity', 4 ], [ 'oink', 'blah' ] ], + [ sort{ $a->[0] cmp $b->[0] } [ 'xxy', 'flop' ], [ 'quantity', 4 ], [ 'oink', 'blah' ] ], '... got the right key value pairs' -); +) or do{ require Data::Dumper; diag(Data::Dumper::Dumper(\@key_value)) }; my %options_elements = $stuff->options_elements; is_deeply(