From c3ca60ca66505356eac0178935e231c8a22ba942 Mon Sep 17 00:00:00 2001 From: pvincent Date: Thu, 16 Jul 2026 21:37:36 +0400 Subject: [PATCH] cleanup --- test/stub/scenario.bash | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/test/stub/scenario.bash b/test/stub/scenario.bash index 8275af0..98f71e2 100755 --- a/test/stub/scenario.bash +++ b/test/stub/scenario.bash @@ -5,6 +5,23 @@ BASEDIR=$(dirname "$0") readonly BASEDIR +# SCENARII + +function do_success { + echo -n 'SUCCESS args=[' + ( + IFS=',' + echo -n "$*" + ) + echo ']' +} + +function do_unbound_variable { + a=5 + echo "a=${a}" + echo "b=${b}" +} + # FUNCTIONS function F2 { @@ -61,24 +78,10 @@ function usage { echo -e "\tthese case scenarii helps testing the miaou-bash script" } -function do_success { - echo -n 'SUCCESS args=[' - ( - IFS='|' - echo -n "$*" - ) - echo ']' -} - -function do_unbound_variable { - a=5 - echo "a=${a}" - echo "b=${b}" -} - function introspect_scenarii { mapfile -t SCENARII <<<"$(compgen -A function | grep ^do_ | sed 's/...//')" } + function test_contain_item { local -n array=$1 for item in "${array[@]}"; do [[ "$item" == "$2" ]] && return 0; done