Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Apparently, InnoDB returns results in a different order than MyISAM t…
…ables. Make tax data comparisons be order insensitive for tests.
  • Loading branch information
perlDreamer committed Nov 24, 2011
1 parent e4de128 commit dbc8408
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions t/Shop/TaxDriver/Generic.t
Expand Up @@ -529,35 +529,35 @@ cmp_deeply(
'importTaxData: error handling for file that does not exist in the filesystem',
);

cmp_deeply(
cmp_bag(
$taxer->getTaxRates($taxingAddress),
[0, 5, 0.5],
'getTaxRates: return correct data for a state with tax data'
);
) or diag Dumper $taxer->getTaxRates($taxingAddress);

cmp_deeply(
cmp_bag(
$taxer->getTaxRates($taxFreeAddress),
[0,0],
'getTaxRates: return correct data for a state with no tax data'
);
) or diag Dumper $taxer->getTaxRates($taxFreeAddress);

cmp_deeply(
cmp_bag(
$taxer->getTaxRates($alternateAddress),
[0.0, 8.25], #Hits USA and Los Angeles, California using the alternate spelling of the state
'getTaxRates: return correct data for a state when the address has alternations'
);
) or diag Dumper $taxer->getTaxRates($alternateAddress);

my $capitalized = $taxer->add({
country => 'USA',
state => 'wi',
taxRate => '50',
});

cmp_deeply(
cmp_bag(
$taxer->getTaxRates($taxingAddress),
[0, 5, 0.5],
'... multiple entries with different capitalization, first matches'
);
) or diag Dumper $taxer->getTaxRates($taxingAddress);

$taxer->delete({ taxId => $capitalized });

Expand Down

0 comments on commit dbc8408

Please sign in to comment.