mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +00:00
Split test into three
This commit is contained in:
parent
2888626334
commit
b69406835f
1
tests/source-bad-file.expected
Normal file
1
tests/source-bad-file.expected
Normal file
@ -0,0 +1 @@
|
|||||||
|
No such file: invalid
|
8
tests/source-bad-file.sh
Executable file
8
tests/source-bad-file.sh
Executable 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
|
1
tests/source-no-file.expected
Normal file
1
tests/source-no-file.expected
Normal file
@ -0,0 +1 @@
|
|||||||
|
No such file:
|
8
tests/source-no-file.sh
Executable file
8
tests/source-no-file.sh
Executable 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
|
@ -8,10 +8,3 @@ cat <<EOF | ../mo --source=source.vars
|
|||||||
{{/ARR}}
|
{{/ARR}}
|
||||||
{{ASSOC_ARR.a}} {{ASSOC_ARR.b}}
|
{{ASSOC_ARR.a}} {{ASSOC_ARR.b}}
|
||||||
EOF
|
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"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user