From b69406835f0caedc827aeda11b47f1d32c99a947 Mon Sep 17 00:00:00 2001 From: Tyler Akins Date: Thu, 21 Jul 2016 09:34:36 -0500 Subject: [PATCH] Split test into three --- tests/source-bad-file.expected | 1 + tests/source-bad-file.sh | 8 ++++++++ tests/source-no-file.expected | 1 + tests/source-no-file.sh | 8 ++++++++ tests/source.sh | 7 ------- 5 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 tests/source-bad-file.expected create mode 100755 tests/source-bad-file.sh create mode 100644 tests/source-no-file.expected create mode 100755 tests/source-no-file.sh 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"