mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Add tests for erasing from multiple scopes
This commit is contained in:
parent
fed64999bc
commit
fb7f2d97e9
@ -921,3 +921,23 @@ foo=bar $FISH -c 'set foo 1 2 3; set --show foo'
|
||||
# CHECK: $foo[2]: |2|
|
||||
# CHECK: $foo[3]: |3|
|
||||
# CHECK: $foo: originally inherited as |bar|
|
||||
|
||||
# Verify behavior of erasing in multiple scopes simultaneously
|
||||
set -U marbles global
|
||||
set -g marbles global
|
||||
set -l marbles local
|
||||
|
||||
set -eUg marbles
|
||||
set -ql marbles || echo "erased in more scopes than it should!"
|
||||
set -qg marbles && echo "didn't erase from global scope!"
|
||||
set -qU marbles && echo "didn't erase from universal scope!"
|
||||
|
||||
begin
|
||||
set -l secret local 4 8 15 16 23 42
|
||||
set -g secret global 4 8 15 16 23 42
|
||||
set -egl secret[3..5]
|
||||
echo $secret
|
||||
# CHECK: local 4 23 42
|
||||
end
|
||||
echo $secret
|
||||
# CHECK: global 4 23 42
|
||||
|
Loading…
x
Reference in New Issue
Block a user