2019-04-26 12:41:49 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-04-27 19:35:10 +00:00
|
|
|
#### $$VERSION$$ v0.70-pre1-6-g3cd6eeb
|
2019-04-26 12:41:49 +00:00
|
|
|
|
|
|
|
# include common functions and definitions
|
|
|
|
# shellcheck source=test/ALL-tests.inc.sh
|
|
|
|
source "./ALL-tests.inc.sh"
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "${TESTDIR}" || exit 1
|
|
|
|
|
|
|
|
# source bashbot.sh function, uncomment if you want to test functions
|
|
|
|
# shellcheck source=./bashbot.sh
|
|
|
|
source "${TESTDIR}/bashbot.sh" source
|
|
|
|
source "${TESTDIR}/modules/background.sh"
|
|
|
|
|
|
|
|
# start writing your tests here ...
|
|
|
|
|
|
|
|
# over write sendJson to output parameter only
|
|
|
|
sendJson() {
|
|
|
|
printf 'chat:%s\tJSON:%s\nURL:%s\n\n' "${1}" "${2}" "${3}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# send text input to send_message
|
|
|
|
|
|
|
|
#set -x
|
|
|
|
echo -n " Send line ..."
|
|
|
|
while IFS='' read -r line || [[ -n "$line" ]]; do
|
|
|
|
echo -n "."
|
|
|
|
send_message "123456" "$line" >>"${OUTPUTFILE}"
|
|
|
|
done < "${INPUTFILE}" 2>>"${LOGFILE}"
|
|
|
|
echo " done."
|
|
|
|
|
2019-04-27 19:10:55 +00:00
|
|
|
{ diff -c "${REFFILE}" "${OUTPUTFILE}" || exit 1; } | cat -v
|
2019-04-26 12:41:49 +00:00
|
|
|
echo " ... all \"send_message\" functions seems to work as expected."
|
|
|
|
echo "${SUCCESS}"
|
|
|
|
|
|
|
|
|