2017-08-04 04:25:20 +00:00
|
|
|
|
|
|
|
####################
|
2017-08-02 03:58:40 +00:00
|
|
|
# Verify behavior of `set --show` given an invalid var name
|
2017-08-04 04:25:20 +00:00
|
|
|
|
|
|
|
####################
|
2017-08-02 03:58:40 +00:00
|
|
|
# Verify behavior of `set --show`
|
2017-08-16 20:39:48 +00:00
|
|
|
$semiempty: not set in local scope
|
|
|
|
$semiempty: set in global scope, unexported, with 1 elements
|
|
|
|
$semiempty[1]: length=0 value=||
|
|
|
|
$semiempty: not set in universal scope
|
|
|
|
|
2017-08-02 03:58:40 +00:00
|
|
|
$var1: not set in local scope
|
|
|
|
$var1: not set in global scope
|
|
|
|
$var1: set in universal scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$var1[1]: length=5 value=|hello|
|
2017-08-02 03:58:40 +00:00
|
|
|
|
|
|
|
$var1: set in local scope, unexported, with 0 elements
|
|
|
|
$var1: set in global scope, unexported, with 2 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$var1[1]: length=7 value=|goodbye|
|
|
|
|
$var1[2]: length=19 value=|and don\'t come back|
|
2017-08-02 03:58:40 +00:00
|
|
|
$var1: set in universal scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$var1[1]: length=5 value=|hello|
|
2017-08-02 03:58:40 +00:00
|
|
|
|
|
|
|
$_unset_var: not set in local scope
|
|
|
|
$_unset_var: not set in global scope
|
|
|
|
$_unset_var: not set in universal scope
|
|
|
|
|
|
|
|
$var2: not set in local scope
|
|
|
|
$var2: set in global scope, unexported, with 0 elements
|
|
|
|
$var2: not set in universal scope
|
|
|
|
|
2017-08-04 06:57:36 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Appending works
|
|
|
|
$var3a: not set in local scope
|
|
|
|
$var3a: set in global scope, unexported, with 6 elements
|
|
|
|
$var3a[1]: length=1 value=|a|
|
|
|
|
$var3a[2]: length=1 value=|b|
|
|
|
|
$var3a[3]: length=1 value=|c|
|
|
|
|
$var3a[4]: length=1 value=|d|
|
|
|
|
$var3a[5]: length=1 value=|e|
|
|
|
|
$var3a[6]: length=1 value=|f|
|
|
|
|
$var3a: not set in universal scope
|
|
|
|
|
|
|
|
$var3b: not set in local scope
|
|
|
|
$var3b: set in global scope, unexported, with 0 elements
|
|
|
|
$var3b: not set in universal scope
|
|
|
|
|
|
|
|
$var3c: not set in local scope
|
|
|
|
$var3c: set in global scope, unexported, with 1 elements
|
|
|
|
$var3c[1]: length=10 value=|one string|
|
|
|
|
$var3c: not set in universal scope
|
|
|
|
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Prepending works
|
|
|
|
$var4a: not set in local scope
|
|
|
|
$var4a: set in global scope, unexported, with 6 elements
|
|
|
|
$var4a[1]: length=1 value=|e|
|
|
|
|
$var4a[2]: length=1 value=|f|
|
|
|
|
$var4a[3]: length=1 value=|d|
|
|
|
|
$var4a[4]: length=1 value=|a|
|
|
|
|
$var4a[5]: length=1 value=|b|
|
|
|
|
$var4a[6]: length=1 value=|c|
|
|
|
|
$var4a: not set in universal scope
|
|
|
|
|
|
|
|
$var4b: not set in local scope
|
|
|
|
$var4b: set in global scope, unexported, with 0 elements
|
|
|
|
$var4b: not set in universal scope
|
|
|
|
|
|
|
|
$var4c: not set in local scope
|
|
|
|
$var4c: set in global scope, unexported, with 1 elements
|
|
|
|
$var4c[1]: length=10 value=|one string|
|
|
|
|
$var4c: not set in universal scope
|
|
|
|
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Appending and prepending at same time works
|
|
|
|
$var5: not set in local scope
|
|
|
|
$var5: set in global scope, unexported, with 8 elements
|
|
|
|
$var5[1]: length=1 value=|0|
|
|
|
|
$var5[2]: length=1 value=|x|
|
|
|
|
$var5[3]: length=1 value=|0|
|
|
|
|
$var5[4]: length=3 value=|abc|
|
|
|
|
$var5[5]: length=3 value=|def|
|
|
|
|
$var5[6]: length=1 value=|0|
|
|
|
|
$var5[7]: length=1 value=|x|
|
|
|
|
$var5[8]: length=1 value=|0|
|
|
|
|
$var5: not set in universal scope
|
|
|
|
|
2017-08-20 04:39:21 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Setting local scope when no local scope of the var uses the closest scope
|
|
|
|
$var6: set in local scope, unexported, with 3 elements
|
|
|
|
$var6[1]: length=3 value=|ghi|
|
|
|
|
$var6[2]: length=3 value=|jkl|
|
|
|
|
$var6[3]: length=3 value=|mno|
|
|
|
|
$var6: set in global scope, unexported, with 2 elements
|
|
|
|
$var6[1]: length=3 value=|ghi|
|
|
|
|
$var6[2]: length=3 value=|jkl|
|
|
|
|
$var6: not set in universal scope
|
|
|
|
|
2018-03-25 06:32:55 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Exporting works
|
|
|
|
TESTVAR0=
|
|
|
|
TESTVAR1=a
|
2018-09-10 01:32:15 +00:00
|
|
|
TESTVAR2=a b
|
2018-03-31 21:57:24 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# if/for/while scope
|
|
|
|
$ifvar1: set in local scope, unexported, with 1 elements
|
|
|
|
$ifvar1[1]: length=4 value=|val1|
|
|
|
|
$ifvar1: not set in global scope
|
|
|
|
$ifvar1: not set in universal scope
|
|
|
|
|
|
|
|
$ifvar2: set in local scope, unexported, with 1 elements
|
|
|
|
$ifvar2[1]: length=4 value=|val2|
|
|
|
|
$ifvar2: not set in global scope
|
|
|
|
$ifvar2: not set in universal scope
|
|
|
|
|
|
|
|
$ifvar3: set in local scope, unexported, with 1 elements
|
|
|
|
$ifvar3[1]: length=4 value=|val3|
|
|
|
|
$ifvar3: not set in global scope
|
|
|
|
$ifvar3: not set in universal scope
|
|
|
|
|
|
|
|
$whilevar1: set in local scope, unexported, with 1 elements
|
|
|
|
$whilevar1[1]: length=4 value=|val3|
|
|
|
|
$whilevar1: not set in global scope
|
|
|
|
$whilevar1: not set in universal scope
|
|
|
|
|
2018-11-18 21:32:43 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# readonly vars
|