diff --git a/tests/source-bad-file.expected b/tests/source-bad-file.expected new file mode 100644 index 0000000..11ad3ae --- /dev/null +++ b/tests/source-bad-file.expected @@ -0,0 +1 @@ +No such file: invalid diff --git a/tests/source-bad-file.sh b/tests/source-bad-file.sh new file mode 100755 index 0000000..650c926 --- /dev/null +++ b/tests/source-bad-file.sh @@ -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 diff --git a/tests/source-no-file.expected b/tests/source-no-file.expected new file mode 100644 index 0000000..c14f926 --- /dev/null +++ b/tests/source-no-file.expected @@ -0,0 +1 @@ +No such file: diff --git a/tests/source-no-file.sh b/tests/source-no-file.sh new file mode 100755 index 0000000..0cf6522 --- /dev/null +++ b/tests/source-no-file.sh @@ -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 diff --git a/tests/source.sh b/tests/source.sh index 806ea73..1b0b1e9 100755 --- a/tests/source.sh +++ b/tests/source.sh @@ -8,10 +8,3 @@ cat </dev/null 2>&1 -[[ "$?" -ne 1 ]] && echo "mo accepted a non existent file"