From f1e010a5a7c562da02a74ffb043520760db49ba3 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Tue, 23 Dec 2014 16:16:08 -0500 Subject: 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 Signed-off-by: Allan McRae --- test/scripts/human_to_size_test.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'test/scripts/human_to_size_test.sh') 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 +# tap_parse_hts -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: -- cgit v1.2.3-24-g4f1b