The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!perl -T

use Test::More;

if (eval 'require bignum') {
  plan tests => 4;
} else {
  plan skip_all => 'bignum is not available';
}

# this script tests format_bytes() with large (very large) numbers


use_ok('Number::Bytes::Human', 'format_bytes');

our @TESTS = (
  '2**80', 2**80, '1.0Y',
  '1023*2**80', 1023*(2**80), '1023Y',
  '1024*2**80', 1024*(2**80), '1024Y' # TODO
);


#  is(format_bytes(2**80), '1.0Y', '2**80 is 1.0Y (yottabyte)');

while (my ($exp, $num, $expected) = splice @TESTS, 0, 3) {
  is(format_bytes($num), $expected, "$exp is $expected");
}