From 72858259ef9bad485f7b37ee97f6bc799d433dfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 30 Aug 2012 15:09:44 +0200 Subject: [PATCH] =?utf8?q?t/form/format=5Famount:=20boilerplate=20entfernt?= =?utf8?q?,=20und=20use=20once=20warnung=20unterdr=C3=BCckt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- t/form/format_amount.t | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/t/form/format_amount.t b/t/form/format_amount.t index 41a25c2d7..a88238ee8 100644 --- a/t/form/format_amount.t +++ b/t/form/format_amount.t @@ -2,42 +2,28 @@ use strict; use Test::More; use lib 't'; +use Support::TestSetup; -use_ok('SL::Form'); -require_ok('SL::Form'); - - -package LxDebugMock; -sub enter_sub {}; -sub leave_sub {}; - -$main::lxdebug = bless({}, 'LxDebugMock'); - -package main; - - -my $form = Form->new(); - +Support::TestSetup::login(); my $config = {}; - $config->{numberformat} = '1.000,00'; -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)'); +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', '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)'); +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