fish-shell/tests/test8.out
ridiculousfish 4b079e16e5 Execute the conditions of if and while statements outside of their block
Variables set in if and while conditions are in the enclosing block, not
the if/while statement block. For example:

    if set -l var (somecommand) ; end
    echo $var

will now work as expected.

Fixes #4820. Fixes #1212.
2018-03-31 14:57:24 -07:00

42 lines
736 B
Text

####################
# Test variable expand
1 2 3 4 5 6 7 8 9 10
10 9 8 7 6 5 4 3 2 1
2 3 4 5 8 7 6
10 9
10 9 8 7 6 5 4 3 2 1
####################
# Test variable set
10 9 8 7 6 5 4 3 2 1
1 2 3 4 5 6 7 8 9 10
10 9 8 7 6 5 4 3 2 1
10 7 8 9 6 5 2 3 4 1
####################
# Test using slices of command substitution
5 4 3 2 1
3 4 5 9 8 7 6 5 4 3 2
####################
# Test more
10 9 8 7 6 5 4 3 2 1
1 2 3 4 5 6 7 8 9 10
####################
# Verify that if statements swallow failure
0
####################
# Verify and/or behavior with if and while statements
success1
success2
success3
success4
####################
# Catch this corner case, which should produce an error
####################
# Loop control in conditions