2019-07-03 10:54:42 +00:00
|
|
|
# RUN: %fish %s
|
|
|
|
# Regression test for issue #4443
|
|
|
|
eval set -l previously_undefined foo
|
|
|
|
echo $previously_undefined
|
|
|
|
# CHECK: foo
|
|
|
|
|
|
|
|
# Test redirection
|
|
|
|
eval "echo you can\\'t see this 1>&2" 2>/dev/null
|
|
|
|
|
|
|
|
# Test return statuses
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval true
|
|
|
|
echo $status
|
2019-07-03 10:54:42 +00:00
|
|
|
# CHECK: 0
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval false
|
|
|
|
echo $status
|
2019-07-03 10:54:42 +00:00
|
|
|
# CHECK: 1
|
|
|
|
|
|
|
|
# Test return status in case of parsing error
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval "("
|
|
|
|
echo $status
|
2020-01-24 01:34:46 +00:00
|
|
|
# CHECK: 123
|
2019-07-03 13:14:49 +00:00
|
|
|
# CHECKERR: {{.*}}checks/eval.fish (line {{\d+}}): Unexpected end of string, expecting ')'
|
2019-07-03 10:54:42 +00:00
|
|
|
# CHECKERR: (
|
|
|
|
# CHECKERR: ^
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval '""'
|
|
|
|
echo $status
|
2020-01-24 01:34:46 +00:00
|
|
|
# CHECK: 123
|
2019-07-03 13:14:49 +00:00
|
|
|
# CHECKERR: {{.*}}checks/eval.fish (line {{\d+}}): The expanded command was empty.
|
2019-07-03 10:54:42 +00:00
|
|
|
# CHECKERR: ""
|
|
|
|
# CHECKERR: ^
|
|
|
|
|
|
|
|
function empty
|
|
|
|
end
|
|
|
|
|
|
|
|
# Regression tests for issue #5692
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval
|
2019-07-03 10:54:42 +00:00
|
|
|
echo blank eval: $status # 0
|
|
|
|
# CHECK: blank eval: 0
|
|
|
|
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval ""
|
2019-07-03 10:54:42 +00:00
|
|
|
echo empty arg eval: $status # 0
|
|
|
|
# CHECK: empty arg eval: 0
|
|
|
|
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval empty
|
2019-07-03 10:54:42 +00:00
|
|
|
echo empty function eval $status # 0
|
|
|
|
# CHECK: empty function eval 0
|
|
|
|
|
2020-01-13 19:34:22 +00:00
|
|
|
false
|
|
|
|
eval "begin; end;"
|
2019-07-03 10:54:42 +00:00
|
|
|
echo empty block eval: $status # 0
|
|
|
|
# CHECK: empty block eval: 0
|
2021-02-15 16:06:43 +00:00
|
|
|
|
|
|
|
source /banana/\t/foo
|
|
|
|
# CHECKERR: source: Error encountered while sourcing file '/banana/\t/foo':
|
|
|
|
# CHECKERR: source: No such file or directory
|