2019-04-22 18:34:43 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-05-30 18:59:17 +00:00
|
|
|
#### $$VERSION$$ v0.90-rc1-0-g93b4914
|
2019-04-22 18:34:43 +00:00
|
|
|
|
|
|
|
# include common functions and definitions
|
|
|
|
# shellcheck source=test/ALL-tests.inc.sh
|
|
|
|
source "./ALL-tests.inc.sh"
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# source bashbot.sh functionw
|
|
|
|
cd "${TESTDIR}" || exit 1
|
|
|
|
|
|
|
|
# run JSON.sh with and without options
|
|
|
|
cd "test" || exit 1
|
|
|
|
echo "Check JSON.sh ..."
|
|
|
|
JSON="../JSON.sh/JSON.sh"
|
|
|
|
|
|
|
|
for i in 1 2
|
|
|
|
do
|
|
|
|
[ "${i}" = "1" ] && echo " ... JSON.sh -s -b -n"
|
|
|
|
[ "${i}" = "2" ] && echo " ... JSON.sh"
|
|
|
|
set +f
|
2019-05-01 09:46:57 +00:00
|
|
|
for jsonfile in ${REFDIR}/*.in
|
2019-04-22 18:34:43 +00:00
|
|
|
do
|
|
|
|
set -f
|
|
|
|
[ "${i}" = "1" ] && "${JSON}" -s -b -n <"${jsonfile}" >"${jsonfile}.out-${i}"
|
|
|
|
[ "${i}" = "2" ] && "${JSON}" <"${jsonfile}" >"${jsonfile}.out-${i}"
|
|
|
|
|
|
|
|
# output processed input
|
2019-05-01 09:46:57 +00:00
|
|
|
diff -c "${jsonfile%.in}.result-${i}" "${jsonfile}.out-${i}" || exit 1
|
2019-04-22 18:34:43 +00:00
|
|
|
done
|
|
|
|
echo "${SUCCESS}"
|
|
|
|
done
|
|
|
|
|
|
|
|
cd "${DIRME}" || exit 1
|