summaryrefslogtreecommitdiff
path: root/t/02-number-handling.t
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-16 23:22:22 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-16 23:22:22 +0000
commita8b15f586f8f9e40e4941ac4148dca6705ce744c (patch)
tree72bd95436e617c48410725cec6fe5b314c2a1c93 /t/02-number-handling.t
parent89172b074ef8db7fbf9121ff13136c74ec102f29 (diff)
More test coverage of LedgerSMB.pm and re-expression of round_amount
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1201 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 't/02-number-handling.t')
-rw-r--r--t/02-number-handling.t31
1 files changed, 29 insertions, 2 deletions
diff --git a/t/02-number-handling.t b/t/02-number-handling.t
index 23eb7fee..b26ed7e4 100644
--- a/t/02-number-handling.t
+++ b/t/02-number-handling.t
@@ -156,11 +156,38 @@ is($form->format_amount({'numberformat' => '1000.00'} , '1.00', 2, 'x'), '1.00',
is($lsmb->format_amount('user' => {'numberformat' => '1000.00'},
'amount' => '1.00', 'precision' => 2, 'neg_format' => 'x'), '1.00',
"lsmb: 1.00 with dash 'x'");
+
+# Triggers the $amount .= "\.$dec" if ($dec ne ""); check to false
is($form->format_amount({'numberformat' => '1000.00'} , '1.00'), '1',
- "form: 1.00 with no precision or dash");
+ "form: 1.00 with no precision or dash (1000.00)");
is($lsmb->format_amount('user' => {'numberformat' => '1000.00'},
'amount' => '1.00'), '1',
- "lsmb: 1.00 with no precision or dash");
+ "lsmb: 1.00 with no precision or dash (1000.00)");
+is($form->format_amount({'numberformat' => '1,000.00'} , '1.00'), '1',
+ "form: 1.00 with no precision or dash (1,000.00)");
+is($lsmb->format_amount('user' => {'numberformat' => '1,000.00'},
+ 'amount' => '1.00'), '1',
+ "lsmb: 1.00 with no precision or dash (1,000.00)");
+is($form->format_amount({'numberformat' => '1 000.00'} , '1.00'), '1',
+ "form: 1.00 with no precision or dash (1 000.00)");
+is($lsmb->format_amount('user' => {'numberformat' => '1 000.00'},
+ 'amount' => '1.00'), '1',
+ "lsmb: 1.00 with no precision or dash (1 000.00)");
+is($form->format_amount({'numberformat' => '1\'000.00'} , '1.00'), '1',
+ "form: 1.00 with no precision or dash (1'000.00)");
+is($lsmb->format_amount('user' => {'numberformat' => '1\'000.00'},
+ 'amount' => '1.00'), '1',
+ "lsmb: 1.00 with no precision or dash (1'000.00)");
+is($form->format_amount({'numberformat' => '1.000,00'} , '1,00'), '1',
+ "form: 1,00 with no precision or dash (1.000,00)");
+is($lsmb->format_amount('user' => {'numberformat' => '1.000,00'},
+ 'amount' => '1,00'), '1',
+ "lsmb: 1,00 with no precision or dash (1.000,00)");
+is($form->format_amount({'numberformat' => '1000,00'} , '1,00'), '1',
+ "form: 1,00 with no precision or dash (1000,00)");
+is($lsmb->format_amount('user' => {'numberformat' => '1000,00'},
+ 'amount' => '1,00'), '1',
+ "lsmb: 1,00 with no precision or dash (1000,00)");
is($form->format_amount({'numberformat' => '1000.00'} , '1.50'), '1.5',
"form: 1.50 with no precision or dash");
is($lsmb->format_amount('user' => {'numberformat' => '1000.00'},