Skip to content
Permalink
Browse files

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 dbc84086b4a9d0a1c700919756b6ab2fc16187ae
Showing with 8 additions and 8 deletions.
  1. +8 −8 t/Shop/TaxDriver/Generic.t
@@ -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 });

0 comments on commit dbc8408

Please sign in to comment.
You can’t perform that action at this time.