mirror of
https://github.com/tests-always-included/mo.git
synced 2025-11-19 23:34:32 +01:00
Fixing empty variable failure for --fail-not-set
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
cd "${0%/*}"
|
||||
unset __NO_SUCH_VAR
|
||||
../mo --fail-not-set ./fail-not-set-file.template 2>&1
|
||||
POPULATED="words" EMPTY="" ../mo --fail-not-set ./fail-not-set-file.template 2>&1
|
||||
|
||||
if [[ $? -ne 1 ]]; then
|
||||
echo "Did not return 1"
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
* {{__NO_SUCH_VAR}}
|
||||
Populated: {{POPULATED}};
|
||||
Empty: {{EMPTY}};
|
||||
Unset: {{__NO_SUCH_VAR}};
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
This will fail: Env variable not set: __NO_SUCH_VAR
|
||||
Populated: words;
|
||||
Empty: ;
|
||||
Unset: Env variable not set: __NO_SUCH_VAR
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
cd "${0%/*}"
|
||||
unset __NO_SUCH_VAR
|
||||
echo "This will fail: {{__NO_SUCH_VAR}}" | ../mo --fail-not-set 2>&1
|
||||
POPULATED="words" EMPTY="" ../mo --fail-not-set 2>&1 <<EOF
|
||||
Populated: {{POPULATED}};
|
||||
Empty: {{EMPTY}};
|
||||
Unset: {{__NO_SUCH_VAR}};
|
||||
EOF
|
||||
|
||||
if [[ $? -ne 1 ]]; then
|
||||
echo "Did not return 1"
|
||||
|
||||
Reference in New Issue
Block a user