Skip to content

Commit

Permalink
Don't depend on hash ordering
Browse files Browse the repository at this point in the history
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
doherty committed Nov 25, 2012
1 parent f98b990 commit 4481736
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions t/00-init.t
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};
4 changes: 2 additions & 2 deletions t/02-langs.t
Original file line number Diff line number Diff line change
Expand Up @@ -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.