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

SF.net SVN: ledger-smb: [343] trunk



Revision: 343
          http://svn.sourceforge.net/ledger-smb/?rev=343&view=rev
Author:   einhverfr
Date:     2006-10-27 13:52:52 -0700 (Fri, 27 Oct 2006)

Log Message:
-----------
Corrected bug in nan comparison in test suite

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/t/02-number-handling.t

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2006-10-27 19:36:15 UTC (rev 342)
+++ trunk/LedgerSMB/Form.pm	2006-10-27 20:52:52 UTC (rev 343)
@@ -520,10 +520,10 @@
 
 	$amount =~ s/,//g;
 	if ($amount =~ s/\((\d*\.?\d*)\)/$1/){
-		$amount *= -1;
+		$amount = $1 * -1;
 	}
 	if ($amount =~ s/(\d*\.?\d*) DR/$1/){
-		$amount *= -1;
+		$amount = $1 * -1;
 	}
 	$amount =~ s/ CR//;
 	$amount = new Math::BigFloat($amount);

Modified: trunk/t/02-number-handling.t
===================================================================
--- trunk/t/02-number-handling.t	2006-10-27 19:36:15 UTC (rev 342)
+++ trunk/t/02-number-handling.t	2006-10-27 20:52:52 UTC (rev 343)
@@ -158,6 +158,6 @@
 
 	is($form->parse_amount(\%myconfig, ''), undef,
 		"Empty string returns undef");
-	cmp_ok($form->parse_amount(\%myconfig, 'foo'), '==',
+	cmp_ok($form->parse_amount(\%myconfig, 'foo'), 'eq',
 		Math::BigFloat->bnan(), "Invalid string returns NaN");
 }


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