diff --git a/test/c-init-test.sh b/test/c-init-test.sh index 25f26c9..ce2155a 100755 --- a/test/c-init-test.sh +++ b/test/c-init-test.sh @@ -10,7 +10,7 @@ # LICENSE: WTFPLv2 http://www.wtfpl.net/txt/copying/ # AUTHOR: KayM (gnadelwartz), kay@rrr.de # -#### $$VERSION$$ v1.21-pre-35-g32b99dc +#### $$VERSION$$ v1.21-pre-36-g0dfbf7b #=============================================================================== # include common functions and definitions @@ -48,7 +48,7 @@ cd "${TESTDIR}" || exit printf "%s\n" "Test if ${JSONSHFILE} exists ..." [ ! -x "$JSONSHFILE" ] && { printf "%s\n" "${NOSUCCESS} json.sh not found"; exit 1; } -printf "Test Sourcing of bashbot.sh ..." +printf "Test Sourcing of bashbot.sh ...\n" # shellcheck source=./bashbot.sh source "${TESTDIR}/bashbot.sh" source diff --git a/test/d-process_inline-test.sh b/test/d-process_inline-test.sh index 1812ecc..11f4b83 100755 --- a/test/d-process_inline-test.sh +++ b/test/d-process_inline-test.sh @@ -1,5 +1,17 @@ #!/usr/bin/env bash -#### $$VERSION$$ v1.20-0-g2ab00a2 +#=============================================================================== +# +# FILE: d-process_inline-test.sh +# +# USAGE: must run only from dev/all-tests.sh +# +# DESCRIPTION: test response to inline messages +# +# LICENSE: WTFPLv2 http://www.wtfpl.net/txt/copying/ +# AUTHOR: KayM (gnadelwartz), kay@rrr.de +# +#### $$VERSION$$ v1.21-pre-36-g0dfbf7b +#=============================================================================== # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh @@ -16,7 +28,7 @@ source "${TESTDIR}/modules/answerInline.sh" source # overwrite get_file for test get_file() { - echo "$1" + printf "%s\n" "$1" } # get telegram input from file @@ -26,19 +38,15 @@ declare -A UPD source <( printf 'UPD=( %s )' "$(sed <<<"${UPDATE}" -E -e 's/\t/=/g' -e 's/=(true|false)/="\1"/')" ) # run process_message with and without python -echo "Check process_inline ..." -for i in 1 2 -do - [ "${i}" = "1" ] && ! command -v python >/dev/null 2>&1 && continue - [ "${i}" = "1" ] && echo " ... with JsonDecode Python" && unset BASHBOT_DECODE - [ "${i}" = "2" ] && echo " ... with JsonDecode Bash" && export BASHBOT_DECODE="yes" - set -x - { process_inline "0"; set +x; } >>"${LOGFILE}" 2>&1; +printf "Check process_inline ...\n" +printf " ... with JsonDecode Bash\n" +set -x +{ process_inline "0"; set +x; } >>"${LOGFILE}" 2>&1; - # output processed input - print_array "iQUERY" >"${OUTPUTFILE}" - compare_sorted "${REFFILE}" "${OUTPUTFILE}" || exit 1 - echo "${SUCCESS}" -done +# output processed input +print_array "iQUERY" >"${OUTPUTFILE}" +compare_sorted "${REFFILE}" "${OUTPUTFILE}" || exit 1 + +printf "%s\n" "${SUCCESS}" cd "${DIRME}" || exit 1 diff --git a/test/d-process_message-test.sh b/test/d-process_message-test.sh index 26ffb2e..f0353ec 100755 --- a/test/d-process_message-test.sh +++ b/test/d-process_message-test.sh @@ -1,5 +1,17 @@ #!/usr/bin/env bash -#### $$VERSION$$ v1.20-0-g2ab00a2 +#=============================================================================== +# +# FILE: d-process_message-test.sh +# +# USAGE: must run only from dev/all-tests.sh +# +# DESCRIPTION: test sending messages +# +# LICENSE: WTFPLv2 http://www.wtfpl.net/txt/copying/ +# AUTHOR: KayM (gnadelwartz), kay@rrr.de +# +#### $$VERSION$$ v1.21-pre-36-g0dfbf7b +#=============================================================================== # include common functions and definitions # shellcheck source=test/ALL-tests.inc.sh @@ -16,7 +28,7 @@ source "${TESTDIR}/commands.sh" source # overwrite get_file for test get_file() { - echo "$1" + printf "%s\n" "$1" } # get telegram input from file @@ -26,7 +38,7 @@ declare -Ax UPD # run process_message -------------- ARRAYS="USER CHAT REPLYTO FORWARD URLS CONTACT CAPTION LOCATION MESSAGE VENUE SERVICE NEWMEMBER LEFTMEMBER PINNED" -echo "Check process_message regular message..." +printf "Check process_message regular message...\n" UPDATE="$(< "${INPUTFILE}")" Json2Array 'UPD' <"${INPUTFILE}" @@ -40,7 +52,7 @@ print_array ${ARRAYS} >"${OUTPUTFILE}" compare_sorted "${REFFILE}" "${OUTPUTFILE}" || exit 1 # run process_message ------------ -echo "Check process_message service message..." +printf "Check process_message service message...\n" UPDATE="$(cat "${INPUTFILE2}")" Json2Array 'UPD' <"${INPUTFILE2}" @@ -54,6 +66,6 @@ print_array ${ARRAYS} >"${OUTPUTFILE}" compare_sorted "${REFFILE2}" "${OUTPUTFILE}" || exit 1 -echo "${SUCCESS}" +printf "%s\n" "${SUCCESS}" cd "${DIRME}" || exit 1