computable-pandoc/scripts/test.sh

26 lines
590 B
Bash
Raw Normal View History

2023-03-09 15:58:14 -06:00
# Makes tests
2023-02-16 19:04:01 -06:00
# Variables
2023-03-11 14:14:24 -06:00
FILTER=dist/linp.lua
2023-02-16 19:04:01 -06:00
# Checks args
2023-03-11 14:14:24 -06:00
if [ -z "$@" ]; then
2023-02-16 19:04:01 -06:00
echo "ERROR: At least one argument is needed. For example:"
echo " sh $0 native"
echo " sh $0 native markdown"
exit 1
fi
2023-03-11 14:14:24 -06:00
# Makes distribution bundle
sh scripts/make_dist.sh
2023-02-16 19:04:01 -06:00
# Does tests
2023-03-10 21:09:31 -06:00
clear && echo "🐾 Starting tests"
2023-03-11 14:14:24 -06:00
for arg in "$@"; do
2023-02-16 19:04:01 -06:00
echo && echo "⚗️ Test in '$arg' format:"
2023-03-09 20:13:01 -06:00
mds=$'\n\n'`(pandoc -t markdown tests/*.md)`
rst=$'\n\n'`(pandoc -t markdown tests/*.rst)`
org=$'\n\n'`(pandoc -t markdown tests/*.org)`
2023-03-11 14:14:24 -06:00
echo "$mds" "$rst" "$org" | pandoc -L $FILTER -t $arg
2023-02-16 19:04:01 -06:00
done