Browse Source

cleanup

main
pvincent 1 week ago
parent
commit
c3ca60ca66
  1. 33
      test/stub/scenario.bash

33
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

Loading…
Cancel
Save