25 lines
564 B
Bash
25 lines
564 B
Bash
# Variables
|
|
DIR=`dirname -- "$0"`
|
|
|
|
# Moves to tests directory and clears the terminal
|
|
cd $DIR
|
|
clear
|
|
|
|
# Checks args
|
|
if [ -z "$*" ]; then
|
|
echo "ERROR: At least one argument is needed. For example:"
|
|
echo " sh $0 native"
|
|
echo " sh $0 native markdown"
|
|
exit 1
|
|
fi
|
|
|
|
# Does tests
|
|
echo "🐾 Starting tests"
|
|
for arg in "$@"; do
|
|
echo && echo "⚗️ Test in '$arg' format:"
|
|
md=`cat src/*.md`
|
|
rst=$'\n'`(pandoc -t markdown src/*.rst)`
|
|
org=$'\n'`pandoc -t markdown src/*.org`
|
|
echo "$md" "$rst" "$org" | pandoc --lua-filter ../src/literate.lua -t $arg
|
|
done
|