[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1193] trunk/t/02-number-handling.t



Revision: 1193
          http://svn.sourceforge.net/ledger-smb/?rev=1193&view=rev
Author:   tetragon
Date:     2007-05-14 18:28:31 -0700 (Mon, 14 May 2007)

Log Message:
-----------
More testing updates

Modified Paths:
--------------
    trunk/t/02-number-handling.t

Modified: trunk/t/02-number-handling.t
===================================================================
--- trunk/t/02-number-handling.t	2007-05-15 01:07:01 UTC (rev 1192)
+++ trunk/t/02-number-handling.t	2007-05-15 01:28:31 UTC (rev 1193)
@@ -64,7 +64,7 @@
 	my $thou = $formats[$format][1];
 	my $dec = $formats[$format][2];
 	foreach my $rawValue ('10t000d00', '9t999d99', '333d33', 
-			'7t777t777d77', '-12d34') {
+			'7t777t777d77', '-12d34', '0d00') {
 		$expected = $rawValue;
 		$expected =~ s/t/$thou/gx;
 		$expected =~ s/d/$dec/gx;
@@ -73,15 +73,23 @@
 		$value =~ s/d/\./gx;
 		##$value = Math::BigFloat->new($value);
 		$value = $form->parse_amount(\%myfooconfig,$value);
-		is($form->format_amount(\%myconfig, $value, 2, 'x'), $expected,
+		is($form->format_amount(\%myconfig, $value, 2, '0'), $expected,
 			"form: $value formatted as $formats[$format][0] - $expected");
 		is($lsmb->format_amount('user' => \%myconfig, 
 			'amount' => $value, 'precision' => 2, 
-			'neg_format' => 'x'), $expected,
+			'neg_format' => '0'), $expected,
 			"lsmb: $value formatted as $formats[$format][0] - $expected");
 	}
 }
 
+$expected = $form->parse_amount({'numberformat' => '1000.00'}, '0.00');
+is($form->format_amount({'numberformat' => '1000.00'} , $expected, 2, 'x'), 'x',
+	"form: 0.00 with dash x");
+is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 
+	'amount' => $expected, 'precision' => 2, 
+	'neg_format' => 'x'), 'x',
+	"lsmb: 0.00 with dash x");
+
 foreach my $format (0 .. $#formats) {
 	%myconfig = (numberformat => $formats[$format][0]);
 	my $thou = $formats[$format][1];


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.