2017-08-04 05:01:56 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Test the -V flag
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Testing -V
|
|
|
|
$foo: set in local scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$foo[1]: length=9 value=|local foo|
|
2017-08-04 05:01:56 +00:00
|
|
|
$foo: set in global scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$foo[1]: length=10 value=|global foo|
|
2017-08-04 05:01:56 +00:00
|
|
|
$foo: not set in universal scope
|
|
|
|
|
|
|
|
$bar: set in local scope, unexported, with 5 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$bar[1]: length=3 value=|one|
|
|
|
|
$bar[2]: length=8 value=|two 2|
|
|
|
|
$bar[3]: length=1 value=|\t|
|
|
|
|
$bar[4]: length=0 value=||
|
|
|
|
$bar[5]: length=1 value=|3|
|
2017-08-04 05:01:56 +00:00
|
|
|
$bar: set in global scope, unexported, with 5 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$bar[1]: length=3 value=|one|
|
|
|
|
$bar[2]: length=8 value=|two 2|
|
|
|
|
$bar[3]: length=1 value=|\t|
|
|
|
|
$bar[4]: length=0 value=||
|
|
|
|
$bar[5]: length=1 value=|3|
|
2017-08-04 05:01:56 +00:00
|
|
|
$bar: not set in universal scope
|
|
|
|
|
|
|
|
$baz: set in local scope, unexported, with 0 elements
|
|
|
|
$baz: set in global scope, unexported, with 0 elements
|
|
|
|
$baz: not set in universal scope
|
|
|
|
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Testing -V with changed variables
|
|
|
|
$foo: set in local scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$foo[1]: length=9 value=|local foo|
|
2017-08-04 05:01:56 +00:00
|
|
|
$foo: set in global scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$foo[1]: length=10 value=|global foo|
|
2017-08-04 05:01:56 +00:00
|
|
|
$foo: not set in universal scope
|
|
|
|
|
|
|
|
$bar: set in local scope, unexported, with 5 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$bar[1]: length=3 value=|one|
|
|
|
|
$bar[2]: length=8 value=|two 2|
|
|
|
|
$bar[3]: length=1 value=|\t|
|
|
|
|
$bar[4]: length=0 value=||
|
|
|
|
$bar[5]: length=1 value=|3|
|
2017-08-04 05:01:56 +00:00
|
|
|
$bar: set in global scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$bar[1]: length=7 value=|bad bar|
|
2017-08-04 05:01:56 +00:00
|
|
|
$bar: not set in universal scope
|
|
|
|
|
|
|
|
$baz: set in local scope, unexported, with 0 elements
|
|
|
|
$baz: set in global scope, unexported, with 1 elements
|
2017-08-05 00:08:25 +00:00
|
|
|
$baz[1]: length=7 value=|bad baz|
|
2017-08-04 05:01:56 +00:00
|
|
|
$baz: not set in universal scope
|
|
|
|
|
2015-05-17 21:17:01 +00:00
|
|
|
Function name1 found
|
2016-11-17 06:00:33 +00:00
|
|
|
Function name2 not found as expected
|
2015-05-17 21:17:01 +00:00
|
|
|
Function name3 found
|
2016-11-17 06:00:33 +00:00
|
|
|
Function name4 not found as expected
|
2017-08-04 05:01:56 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Verify that functions can be copied. Tests against regression of issue #3601
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Checking that the copied functions are identical other than the name
|
2018-12-16 19:23:41 +00:00
|
|
|
function name1 --argument arg1 arg2
|
|
|
|
function name1a --argument arg1 arg2
|
|
|
|
1 = 1a
|
|
|
|
function name3 --argument arg1 arg2
|
|
|
|
function name3a --argument arg1 arg2
|
|
|
|
3 = 3a
|
2018-02-25 18:25:29 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Checking reserved names
|
2019-02-01 17:29:54 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Checking `functions -q` without arguments
|
|
|
|
False
|