mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 19:49:15 +08:00
2924751488
When setting a variable without a specified scope, we should give priority
to an existing local or global above an existing universal variable with
the same name.
In 16fd780484
there was a regression that
made universal variables have priority.
Fixes #5883
69 lines
1.1 KiB
Plaintext
69 lines
1.1 KiB
Plaintext
Test 1 pass
|
|
Test 2 pass
|
|
Test 3 pass
|
|
Test 4 pass
|
|
Test 5 pass
|
|
Test 6 pass
|
|
Test 7 pass
|
|
Test 8 pass
|
|
Test 9 pass
|
|
Test 10 pass
|
|
Test 11 pass
|
|
Test 12 pass
|
|
Test 13 pass
|
|
Test 14 pass
|
|
Test 15 pass
|
|
Foo change detected
|
|
Foo change detected
|
|
count:5 content:[functionblock function global universal blocklocal]
|
|
Test 16 pass
|
|
__fish_test_env17=UNSHADOWED
|
|
SHADOWED
|
|
__fish_test_env17=UNSHADOWED
|
|
wuwuwu
|
|
boo
|
|
wuwuwu
|
|
foo
|
|
bar
|
|
bar
|
|
Testing Universal Startup
|
|
1
|
|
1
|
|
2
|
|
2
|
|
testu undef in top level shell
|
|
testu undef in sub shell
|
|
SHLVL: 1
|
|
SHLVL: 2
|
|
SHLVL: 1
|
|
SHLVL: 1
|
|
SHLVL: 1
|
|
SHLVL: 4
|
|
SHLVL: 4
|
|
Elements in DISPLAY: 1
|
|
Elements in FOO and FOOPATH: 1 4
|
|
MANPATH=man1:man2:man3
|
|
DONT_ESCAPE_COLONS=1: 2: :3:
|
|
DONT_ESCAPE_SPACES=1 2 3 4
|
|
DONT_ESCAPE_COLONS_PATH=1::2:::3:
|
|
|
|
####################
|
|
# Path universal variables
|
|
a b c 1:2:3 a b c 1 2 3
|
|
a b c 1 2 3 a b c 1 2 3
|
|
a:b:c 1 2 3 a b c 1 2 3
|
|
a:b:c 1:2:3 a b c 1 2 3
|
|
1:2:3 1 2 3
|
|
a:b a b
|
|
|
|
####################
|
|
# Variable names in other commands
|
|
|
|
####################
|
|
# Global vs Universal Unspecified Scopes
|
|
global-vs-universal 1: universal
|
|
global-vs-universal 2: global
|
|
global-vs-universal 3: global2
|
|
global-vs-universal 4: universal
|
|
global-vs-universal 5:
|