From 6391fead9523a9744a63213533c28e6ce425d51a Mon Sep 17 00:00:00 2001 From: tetragon Date: Fri, 27 Oct 2006 19:23:56 +0000 Subject: 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 --- t/02-number-handling.t | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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"); } -- cgit v1.2.3