1 package Support::TestRoutines;
4 use List::MoreUtils qw(any);
7 our @ISA = qw(Exporter);
9 our @EXPORT = qw(test_deeply);
12 my ($first, $second, $description, @ignore_keys) = @_;
14 my @first_keys = keys %{$first};
15 my @second_keys = keys %{$second};
16 foreach my $key (@first_keys) {
17 if (!any { $_ eq $key } @ignore_keys) {
18 if (!any { $_ eq $key } @second_keys) {
19 ok(0, $description . ": " . $key);
23 foreach my $key (@second_keys) {
24 if (!any { $_ eq $key } @ignore_keys) {
25 if (!any { $_ eq $key } @first_keys) {
26 ok(0, $description . ": " . $key);
28 is($first->{$key}, $second->{$key}, $description . ": " . $key);