diff options
-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"); } |