logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: bd586e9fb615da538476cd6e8aa11bfb0380a9c4
parent 067a8fb175199502c11a0dc96f513477a908492f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun, 30 Jan 2022 14:58:21 +0100

test-bin/strings: regroup test cases

Diffstat:

Mtest-bin/strings66++++++++++++------------------------------------------------------
1 file changed, 12 insertions(+), 54 deletions(-)

diff --git a/test-bin/strings b/test-bin/strings @@ -1,79 +1,37 @@ #!/usr/bin/env atf-sh -atf_test_case allfile -allfile_body() { +atf_test_case allbytes +allbytes_body() { atf_check -o file:outputs/strings/all_bytes ../bin/strings inputs/all_bytes -} - -atf_test_case allinput -allinput_body() { atf_check -o file:outputs/strings/all_bytes ../bin/strings <inputs/all_bytes -} - -atf_test_case alldashinput -alldashinput_body() { atf_check -o file:outputs/strings/all_bytes ../bin/strings - <inputs/all_bytes } -atf_test_case truefile -truefile_body() { +atf_test_case trueelf +trueelf_body() { atf_check -o file:outputs/strings/true ../bin/strings inputs/strings/true -} - -atf_test_case trueinput -trueinput_body() { atf_check -o file:outputs/strings/true ../bin/strings <inputs/strings/true -} - -atf_test_case truedashinput -truedashinput_body() { atf_check -o file:outputs/strings/true ../bin/strings - <inputs/strings/true } -atf_test_case true8file -true8file_body() { +atf_test_case true8elf +true8elf_body() { atf_check -o file:outputs/strings/true_8 ../bin/strings -n 8 inputs/strings/true -} - -atf_test_case true8input -true8input_body() { atf_check -o file:outputs/strings/true_8 ../bin/strings -n 8 <inputs/strings/true -} - -atf_test_case true8dashinput -true8dashinput_body() { atf_check -o file:outputs/strings/true_8 ../bin/strings -n 8 - <inputs/strings/true } -atf_test_case nullfile -nullfile_body() { +atf_test_case devnull +devnull_body() { atf_check ../bin/strings /dev/null -} - -atf_test_case nullinput -nullinput_body() { atf_check ../bin/strings </dev/null -} - -atf_test_case nulldashinput -nulldashinput_body() { atf_check ../bin/strings - </dev/null } atf_init_test_cases() { cd "$(atf_get_srcdir)" - atf_add_test_case allfile - atf_add_test_case allinput - atf_add_test_case alldashinput - - atf_add_test_case truefile - atf_add_test_case trueinput - atf_add_test_case truedashinput - - atf_add_test_case true8file - atf_add_test_case true8input - atf_add_test_case true8dashinput - atf_add_test_case nullfile - atf_add_test_case nullinput - atf_add_test_case nulldashinput + atf_add_test_case allbytes + atf_add_test_case trueelf + atf_add_test_case true8elf + atf_add_test_case devnull }