mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 08:26:21 +00:00
7e86c1a5f5
It is possible to declare a variable but not assign a value to it using `export x`. When you do this, `declare -p x` shows the variable but does not show an "=" nor any value afterwards. When running another command, this variable will not be added to the environment variables even though it is flagged as exported. Most likely it's because the value is not a string and can't be easily converted to a string; this is the same behavior as arrays. Using `[[ -v x ]]` is also inadequate and I believe its because there are false positives when trying to access data, which goes on to break tests and the new braces and parenthesis indirection. Perhaps it could be reviewed and made to work. The best solution so far is to combine `declare -p` with `[[ -v` to see if the variable is declared and if a value is set. Closes #75.
10 lines
152 B
Bash
Executable File
10 lines
152 B
Bash
Executable File
#!/usr/bin/env bash
|
|
cd "${0%/*}" || exit 1
|
|
. ../run-tests
|
|
|
|
export uv
|
|
export template='{{^uv}}OK{{/uv}}{{#uv}}FAIL{{/uv}}'
|
|
export expected='OK'
|
|
|
|
runTest
|