Assert and and or create no new scope

This commit is contained in:
Pablo Santiago Blum de Aguiar 2022-01-13 22:12:13 +01:00 committed by Fabian Homborg
parent a22779e807
commit 6315cf67ec

View File

@ -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