We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b631a9 commit 8a996edCopy full SHA for 8a996ed
tests/util/test_util.sh
@@ -4,11 +4,27 @@
4
test_util.is_exported() {
5
local variable_name="$1"
6
7
- local -n variable="$variable_name"
8
- if [[ "${variable@a}" == *x* ]]; then
9
- return 0
+ if (( BASH_VERSINFO[0] > 4 )) || (( BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4 )); then
+ local -n variable="$variable_name"
+ if [[ "${variable@a}" == *x* ]]; then
10
+ return 0
11
+ else
12
+ return 1
13
+ fi
14
else
- return 1
15
+ if declare -x | while read -r line; do
16
+ case "$line" in
17
+ "declare -x $variable_name"=*) return 10 ;;
18
+ esac
19
+ done; then
20
21
22
+ if (($? == 10)); then
23
24
25
26
27
28
fi
29
}
30
0 commit comments