From a0cd7d697f36397a32a90565fee3986f95f17e93 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Wed, 29 Aug 2012 15:55:25 +0200 Subject: [PATCH] Tests zu SL::Format::format_amount mit Beschreibung versehen --- t/form/format_amount.t | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/t/form/format_amount.t b/t/form/format_amount.t index 2c6e90da8..a5a4306c6 100644 --- a/t/form/format_amount.t +++ b/t/form/format_amount.t @@ -24,20 +24,20 @@ my $config = {}; $config->{numberformat} = '1.000,00'; -is($form->format_amount($config, '1e1', 2), '10,00', 'blaa'); -is($form->format_amount($config, 1000, 2), '1.000,00', 'blaa'); -is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'blaa'); -is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'blaa'); -is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'blaa'); +is($form->format_amount($config, '1e1', 2), '10,00', 'format 1e1 (numberformat: 1.000,00)'); +is($form->format_amount($config, 1000, 2), '1.000,00', 'format 1000 (numberformat: 1.000,00)'); +is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'format 1000.1234 (numberformat: 1.000,00)'); +is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'format 1000000000.1234 (numberformat: 1.000,00)'); +is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'format -1000000000.1234 (numberformat: 1.000,00)'); $config->{numberformat} = '1,000.00'; -is($form->format_amount($config, '1e1', 2), '10.00', 'blaa'); -is($form->format_amount($config, 1000, 2), '1,000.00', 'blaa'); -is($form->format_amount($config, 1000.1234, 2), '1,000.12', 'blaa'); -is($form->format_amount($config, 1000000000.1234, 2), '1,000,000,000.12', 'blaa'); -is($form->format_amount($config, -1000000000.1234, 2), '-1,000,000,000.12', 'blaa'); +is($form->format_amount($config, '1e1', 2), '10,00', 'format 1e1 (numberformat: 1,000.00)'); +is($form->format_amount($config, 1000, 2), '1.000,00', 'format 1000 (numberformat: 1,000.00)'); +is($form->format_amount($config, 1000.1234, 2), '1.000,12', 'format 1000.1234 (numberformat: 1,000.00)'); +is($form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'format 1000000000.1234 (numberformat: 1,000.00)'); +is($form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'format -1000000000.1234 (numberformat: 1,000.00)'); done_testing; -- 2.20.1