From 6b4bf3b692cfb045c2de6a4ac53bb28fae416892 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 19 Feb 2007 21:17:02 +0000 Subject: Changing tests to match new handling of empty strings git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@817 4979c152-3d1c-0410-bac9-87ea11338e46 --- t/02-number-handling.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/02-number-handling.t') diff --git a/t/02-number-handling.t b/t/02-number-handling.t index 177ce438..4add3b1f 100644 --- a/t/02-number-handling.t +++ b/t/02-number-handling.t @@ -115,8 +115,8 @@ foreach my $format (0 .. $#formats) { cmp_ok($form->parse_amount(\%myconfig, $expected), '==', $value, "$expected parsed as $formats[$format][0] - $value"); - is($form->parse_amount(\%myconfig, ''), undef, - "Empty string returns undef"); + cmp_ok($form->parse_amount(\%myconfig, ''), '==', 0, + "Empty string returns 0"); cmp_ok($form->parse_amount(\%myconfig, 'foo'), 'eq', Math::BigFloat->bnan(), "Invalid string returns NaN"); } @@ -156,8 +156,8 @@ foreach my $format (0 .. $#formats) { '==', $value, "$expected parsed as $formats[$format][0] - $value"); - is($form->parse_amount(\%myconfig, ''), undef, - "Empty string returns undef"); + cmp_ok($form->parse_amount(\%myconfig, ''), '==', 0, + "Empty string returns 0"); cmp_ok($form->parse_amount(\%myconfig, 'foo'), 'eq', Math::BigFloat->bnan(), "Invalid string returns NaN"); } -- cgit v1.2.3