diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-27 19:23:56 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-27 19:23:56 +0000 |
commit | 6391fead9523a9744a63213533c28e6ce425d51a (patch) | |
tree | e08059a956aa8c83df2930ca65b0dd9d29c28edb /t | |
parent | 8551fb77755c633dc5c67594dedca6cb71679f1a (diff) |
Update tests for parsing of added negation forms
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@341 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 't')
-rw-r--r-- | t/02-number-handling.t | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/02-number-handling.t b/t/02-number-handling.t index d75fda3d..a59b0ac5 100644 --- a/t/02-number-handling.t +++ b/t/02-number-handling.t @@ -106,6 +106,14 @@ foreach my $format (0 .. $#formats) { cmp_ok($form->parse_amount(\%myconfig, $expected), '==', $value, "$expected parsed as $formats[$format][0] - $value"); } + $expected = '12 CR'; + my $value = Math::BigFloat->new('12'); + cmp_ok($form->parse_amount(\%myconfig, $expected), '==', $value, + "$expected parsed as $formats[$format][0] - $value"); + $expected = '21 DR'; + $value = Math::BigFloat->new('-21'); + cmp_ok($form->parse_amount(\%myconfig, $expected), '==', $value, + "$expected parsed as $formats[$format][0] - $value"); } foreach my $format (0 .. $#formats) { @@ -130,4 +138,16 @@ foreach my $format (0 .. $#formats) { '==', $value, "$expected parsed as $formats[$format][0] - $value"); } + $expected = '12 CR'; + my $value = Math::BigFloat->new('12'); + cmp_ok($form->parse_amount(\%myconfig, + $form->parse_amount(\%myconfig, $expected)), + '==', $value, + "$expected parsed as $formats[$format][0] - $value"); + $expected = '21 DR'; + $value = Math::BigFloat->new('-21'); + cmp_ok($form->parse_amount(\%myconfig, + $form->parse_amount(\%myconfig, $expected)), + '==', $value, + "$expected parsed as $formats[$format][0] - $value"); } |