#!perl
my
$data_rate
= Number::DataRate->new;
is(
$data_rate
->to_bits_per_second(
'0.045 kbit/s'
),
'45'
);
is(
$data_rate
->to_bits_per_second(
'0.045 kb/s'
),
'45'
);
is(
$data_rate
->to_bits_per_second(
'0.045 kbitps'
),
'45'
);
is(
$data_rate
->to_bits_per_second(
'0.045 kbps'
),
'45'
);
is(
$data_rate
->to_bytes_per_second(
'0.045 kbit/s'
),
'5.625'
);
is(
$data_rate
->to_bytes_per_second(
'0.045 kb/s'
),
'5.625'
);
is(
$data_rate
->to_bytes_per_second(
'0.045 kbitps'
),
'5.625'
);
is(
$data_rate
->to_bytes_per_second(
'0.045 kbps'
),
'5.625'
);
is(
$data_rate
->to_bits_per_second(
'5.625Byte/s'
),
'45'
);
is(
$data_rate
->to_bits_per_second(
'5.625B/s'
),
'45'
);
is(
$data_rate
->to_bits_per_second(
'5.625Byteps'
),
'45'
);
is(
$data_rate
->to_bits_per_second(
'5.625Bps'
),
'45'
);
is(
$data_rate
->to_bytes_per_second(
'5.625Byte/s'
),
'5.625'
);
is(
$data_rate
->to_bytes_per_second(
'5.625B/s'
),
'5.625'
);
is(
$data_rate
->to_bytes_per_second(
'5.625Byte/s'
),
'5.625'
);
is(
$data_rate
->to_bytes_per_second(
'5.625Bps'
),
'5.625'
);
is(
$data_rate
->to_bits_per_second(
'9.6 kbit/s'
),
'9600'
);
is(
$data_rate
->to_bytes_per_second(
'9.6 kbit/s'
),
'1200'
);
is(
$data_rate
->to_bits_per_second(
'14.4 kbit/s'
),
'14400'
);
is(
$data_rate
->to_bytes_per_second(
'14.4 kbit/s'
),
'1800'
);
is(
$data_rate
->to_bits_per_second(
'64 kbit/s'
),
'64000'
);
is(
$data_rate
->to_bytes_per_second(
'64 kbit/s'
),
'8000'
);
is(
$data_rate
->to_bits_per_second(
'1000 kbit/s'
),
'1000000'
);
is(
$data_rate
->to_bytes_per_second(
'1000 kbit/s'
),
'125000'
);
is(
$data_rate
->to_bits_per_second(
'3000 kbit/s'
),
'3000000'
);
is(
$data_rate
->to_bytes_per_second(
'3000 kbit/s'
),
'375000'
);
is(
$data_rate
->to_bits_per_second(
'10 Mbit/s'
),
'10000000'
);
is(
$data_rate
->to_bytes_per_second(
'10 Mbit/s'
),
'1250000'
);
is(
$data_rate
->to_bits_per_second(
'24,576 kbit/s'
),
'24576000'
);
is(
$data_rate
->to_bytes_per_second(
'24,576 kbit/s'
),
'3072000'
);
is(
$data_rate
->to_bits_per_second(
'54.0 Mbit/s'
),
'54000000'
);
is(
$data_rate
->to_bytes_per_second(
'54.0 Mbit/s'
),
'6750000'
);
is(
$data_rate
->to_bits_per_second(
'100 Mbit/s'
),
'100000000'
);
is(
$data_rate
->to_bytes_per_second(
'100 Mbit/s'
),
'12500000'
);
is(
$data_rate
->to_bits_per_second(
'248.0 Mbit/s'
),
'248000000'
);
is(
$data_rate
->to_bytes_per_second(
'1248.0 Mbit/s'
),
'156000000'
);
is(
$data_rate
->to_bits_per_second(
'1000 Mbit/s'
),
'1000000000'
);
is(
$data_rate
->to_bytes_per_second(
'1000 Mbit/s'
),
'125000000'
);
is(
$data_rate
->to_bits_per_second(
'6.4 Gbit/s'
),
'6400000000'
);
is(
$data_rate
->to_bytes_per_second(
'6.4 Gbit/s'
),
'800000000'
);
is(
$data_rate
->to_bits_per_second(
'10,000 Mbit/s'
),
'10000000000'
);
is(
$data_rate
->to_bytes_per_second(
'10,000 Mbit/s'
),
'1250000000'
);
is(
$data_rate
->to_bits_per_second(
'84.8 Gbit/s'
),
'84800000000'
);
is(
$data_rate
->to_bytes_per_second(
'84.8 Gbit/s'
),
'10600000000'
);
is(
$data_rate
->to_bits_per_second(
'100,000 Mbit/s'
),
'100000000000'
);
is(
$data_rate
->to_bytes_per_second(
'100,000 Mbit/s'
),
'12500000000'
);
is(
$data_rate
->to_bits_per_second(
'1.28Tbit/s'
),
'1280000000000'
);
is(
$data_rate
->to_bytes_per_second(
'1.28Tbit/s'
),
'160000000000'
);