Permalink
Browse files

Don't depend on hash ordering

New hash key randomization as of 7dc8663 (v5.17.6)
caused the test suite to fail due to unintended
reliance on hash key ordering. This attempts to
fix the tests to avoid that dependency.
  • Loading branch information...
1 parent f98b990 commit 4481736ab436b99c170223047010b7f8bfa740d3 @doherty committed Nov 25, 2012
Showing with 6 additions and 6 deletions.
  1. +4 −4 t/00-init.t
  2. +2 −2 t/02-langs.t
View
@@ -25,24 +25,24 @@ subtest 'oo' => sub {
can_ok($bool, qw(boolean langs languages _looks_true _looks_false));
{ # Language codes
my @has = $bool->langs();
- is_deeply(\@has, \@should_have_codes, 'Available language codes OK');
+ is_deeply([sort @has], [sort @should_have_codes], 'Available language codes OK');
}
{ # Languages names
my @has = $bool->languages();
- is_deeply(\@has, \@should_have_names, 'Available language names OK');
+ is_deeply([sort @has], [sort @should_have_names], 'Available language names OK');
}
};
subtest 'func' => sub {
plan tests => 2;
{ # Language codes
my @has = Lingua::Boolean::langs();
- is_deeply(\@has, \@should_have_codes, 'Available language codes OK');
+ is_deeply([sort @has], [sort @should_have_codes], 'Available language codes OK');
}
{ # Language names
my @has = Lingua::Boolean::languages();
- is_deeply(\@has, \@should_have_names, 'Available language names OK');
+ is_deeply([sort @has], [sort @should_have_names], 'Available language names OK');
}
};
View
@@ -5,5 +5,5 @@ use Test::More tests => 1;
use Lingua::Boolean;
my @langs = Lingua::Boolean::languages();
-is_deeply \@langs, ['English', "Fran\x{e7}ais"]
- or diag explain \@langs;
+is_deeply [sort @langs], [sort 'English', "Fran\x{e7}ais"]
+ or diag explain [sort @langs];

0 comments on commit 4481736

Please sign in to comment.