index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2014-12-23 16:16:08 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-12-28 13:06:39 +1000 |
commit | f1e010a5a7c562da02a74ffb043520760db49ba3 (patch) | |
tree | 5a9feb4c8d6a23e5410ab9da0cbf43b15e2485e3 /test/scripts/human_to_size_test.sh | |
parent | 29c0d8233b32ab3ad1dcd7c3bf1161449a386dea (diff) |
-rwxr-xr-x | test/scripts/human_to_size_test.sh | 34 |
diff --git a/test/scripts/human_to_size_test.sh b/test/scripts/human_to_size_test.sh index e412e836..6334495f 100755 --- a/test/scripts/human_to_size_test.sh +++ b/test/scripts/human_to_size_test.sh @@ -15,43 +15,43 @@ if ! type -t human_to_size &>/dev/null; then exit 1 fi -parse_hts() { +tap_parse_hts() { local input=$1 expected=$2 tap_is_str "$(human_to_size "$input")" "$expected" "$input" } tap_plan 15 -# parse_hts <input> <expected output> +# tap_parse_hts <input> <expected output> -parse_hts '1MiB' 1048576 +tap_parse_hts '1MiB' 1048576 -parse_hts '10XiB' '' +tap_parse_hts '10XiB' '' -parse_hts '10 MiB' 10485760 +tap_parse_hts '10 MiB' 10485760 -parse_hts '10 XiB' '' +tap_parse_hts '10 XiB' '' -parse_hts '.1 TiB' 109951162778 +tap_parse_hts '.1 TiB' 109951162778 -parse_hts ' -3 KiB ' -3072 +tap_parse_hts ' -3 KiB ' -3072 -parse_hts 'foo3KiB' '' +tap_parse_hts 'foo3KiB' '' -parse_hts '3KiBfoo' '' +tap_parse_hts '3KiBfoo' '' -parse_hts '3kib' '' +tap_parse_hts '3kib' '' -parse_hts '+1KiB' 1024 +tap_parse_hts '+1KiB' 1024 -parse_hts '+1.0 KiB' 1024 +tap_parse_hts '+1.0 KiB' 1024 -parse_hts '1MB' 1000000 +tap_parse_hts '1MB' 1000000 -parse_hts '1M' 1048576 +tap_parse_hts '1M' 1048576 -parse_hts ' 1 G ' 1073741824 +tap_parse_hts ' 1 G ' 1073741824 -parse_hts '1Q' '' +tap_parse_hts '1Q' '' # vim: set noet: |