Revert "Handle huge numbers better"

This reverts commit ef0039bc33.

Abysmal performance: revbank2beancount went from 0.7 to 11 seconds for
revspace's 2024 .revbank.log to date.
This commit is contained in:
Juerd Waalboer 2024-08-28 06:41:02 +02:00
parent 599bf1bc98
commit f16e406063
5 changed files with 41 additions and 54 deletions

View file

@ -40,12 +40,6 @@ cmp_ok(RevBank::Amount->parse_string("4 ")->cents, '==', 400);
cmp_ok(RevBank::Amount->new_from_float(.425)->cents, '==', 42);
my $big = "9" x 123;
cmp_ok(RevBank::Amount->new($big)->cents, 'eq', $big);
cmp_ok(RevBank::Amount->parse_string($big)->cents, 'eq', $big . "00");
cmp_ok(RevBank::Amount->new_from_float($big)->cents, 'eq', $big . "00");
# comparisons
ok($a);
ok(!RevBank::Amount->new(0));
@ -142,8 +136,6 @@ like(warning { rand $a }, qr/float/);
# Invalid amounts
throws_ok(sub { RevBank::Amount->new(1.1) }, qr/Non-integer/);
throws_ok(sub { RevBank::Amount->new("+Inf") }, qr/Infinite/);
is(RevBank::Amount->parse_string("0.000"), undef);
is(RevBank::Amount->parse_string("0.042"), undef);
is(RevBank::Amount->parse_string("+0.042"), undef);