logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: d4813137797801fe715b0d0b6d20d2ebdc031f30
parent 99691c19f2f3cb46181b148ba8b2414555d33449
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 11 Feb 2022 19:44:33 +0100

bin/humanize: Fix usage message

Diffstat:

Mbin/humanize.c2+-
Mtest-bin/humanize8++++++++
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/humanize.c b/bin/humanize.c @@ -17,7 +17,7 @@ void usage() { - fprintf(stderr, "Usage: humanize [-bd] number"); + fprintf(stderr, "Usage: humanize [-bd] number\n"); } int diff --git a/test-bin/humanize b/test-bin/humanize @@ -52,8 +52,16 @@ seven_body() { atf_check -o "inline:1206Ki \n" ../bin/humanize -b 1234567 } +atf_test_case noarg +noarg_body() { + atf_check -s exit:1 -e 'inline:Usage: humanize [-bd] number\n' ../bin/humanize +} + atf_init_test_cases() { cd "$(atf_get_srcdir)" + + atf_add_test_case noarg + atf_add_test_case one atf_add_test_case two atf_add_test_case three