1# please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*- 2package TestAPRlib::string; 3 4use strict; 5use warnings FATAL => 'all'; 6 7use Apache::Test; 8use Apache::TestUtil; 9 10use APR::String (); 11 12my %size_string = ( 13 '-1' => " - ", 14 0 => " 0 ", 15 42 => " 42 ", 16 42_000 => " 41K", 17 42_000_000 => " 40M", 18# 42_000_000_000 => "40G", 19); 20 21sub num_of_tests { 22 return scalar keys %size_string; 23} 24 25sub test { 26 27 t_debug("size_string"); 28 while (my ($k, $v) = each %size_string) { 29 ok t_cmp($v, APR::String::format_size($k)); 30 } 31} 32 331; 34