logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 8c4ff5d08d7529f459bd96e77d2feb0f9ebd6469
parent 6283191de21fb1a57ed3059caf0d6efea2f91cba
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 12 Mar 2022 14:30:52 +0100

bin/pwd: Simplify for better coverage

Diffstat:

Mbin/pwd.c8+-------
Mtest-bin/pwd2+-
2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/bin/pwd.c b/bin/pwd.c @@ -6,12 +6,6 @@ #include <stdio.h> /* puts, perror, printf */ #include <unistd.h> /* getcwd() */ -void -usage(char *a0) -{ - (void)printf("usage: %s\n", a0); -} - int main(int argc, char *argv[]) { @@ -19,7 +13,7 @@ main(int argc, char *argv[]) if(argc != 1) { - usage(argv[0]); + fprintf(stderr, "usage: pwd\n"); return 1; } diff --git a/test-bin/pwd b/test-bin/pwd @@ -7,7 +7,7 @@ simple_body() { atf_test_case args args_body() { - atf_check -s exit:1 -o "inline:usage: ../bin/pwd\n" ../bin/pwd -H + atf_check -s exit:1 -e "inline:usage: pwd\n" ../bin/pwd -H } atf_test_case enoent cleanup