Split test into three

This commit is contained in:
Tyler Akins 2016-07-21 09:34:36 -05:00
parent 2888626334
commit b69406835f
5 changed files with 18 additions and 7 deletions

View File

@ -0,0 +1 @@
No such file: invalid

8
tests/source-bad-file.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
cd "${0%/*}"
echo "Do not display this" | ../mo --source=invalid 2>&1
if [[ $? -ne 1 ]]; then
echo "Did not return 1"
fi

View File

@ -0,0 +1 @@
No such file:

8
tests/source-no-file.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
cd "${0%/*}"
echo "Do not display this" | ../mo --source= 2>&1
if [[ $? -ne 1 ]]; then
echo "Did not return 1"
fi

View File

@ -8,10 +8,3 @@ cat <<EOF | ../mo --source=source.vars
{{/ARR}}
{{ASSOC_ARR.a}} {{ASSOC_ARR.b}}
EOF
# Prints the string should mo NOT fail. Meaning that the output will not match
# tests/source.expected and therefore the test will fail.
../mo --source=a/non/existent/file files >/dev/null 2>&1
[[ "$?" -ne 1 ]] && echo "mo accepted a non existent file"