Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test/scripts/human_to_size_test.sh
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2014-12-23 16:16:08 -0500
committerAllan McRae <allan@archlinux.org>2014-12-28 13:06:39 +1000
commitf1e010a5a7c562da02a74ffb043520760db49ba3 (patch)
tree5a9feb4c8d6a23e5410ab9da0cbf43b15e2485e3 /test/scripts/human_to_size_test.sh
parent29c0d8233b32ab3ad1dcd7c3bf1161449a386dea (diff)
add tap_ prefix to test helper functions
Allows tap.sh to show the line number where the helper function was called on failures. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/scripts/human_to_size_test.sh')
-rwxr-xr-xtest/scripts/human_to_size_test.sh34
1 files changed, 17 insertions, 17 deletions
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: