mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Assert and
and or
create no new scope
This commit is contained in:
parent
a22779e807
commit
6315cf67ec
@ -635,6 +635,34 @@ end
|
||||
#CHECK: $var6[1]: |ghi|
|
||||
#CHECK: $var6[2]: |jkl|
|
||||
|
||||
# `and` creates no new scope on its own
|
||||
true; and set -l var7a 89 179
|
||||
set -q var7a
|
||||
echo $status
|
||||
#CHECK: 0
|
||||
|
||||
# `begin` of an `and` creates a new scope
|
||||
true; and begin
|
||||
set -l var7b 359 719
|
||||
end
|
||||
set -q var7b
|
||||
echo $status
|
||||
#CHECK: 1
|
||||
|
||||
# `or` creates no new scope on its own
|
||||
false; or set -l var8a 1439 2879
|
||||
set -q var8a
|
||||
echo $status
|
||||
#CHECK: 0
|
||||
|
||||
# `begin` of an `or` creates a new scope
|
||||
false; or begin
|
||||
set -l var8b 9091 9901
|
||||
end
|
||||
set -q var8b
|
||||
echo $status
|
||||
#CHECK: 1
|
||||
|
||||
# Exporting works
|
||||
set -x TESTVAR0
|
||||
set -x TESTVAR1 a
|
||||
|
Loading…
x
Reference in New Issue
Block a user