mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 14:24:35 +08:00
c27fb9b802
Otherwise this would look weird if you had, say, a tab in there. See #7716. (note that this doesn't handle e.g. zero-width-joiners, because those aren't currently escaped. we might want to add an escape mode for unprintable characters, but for combining codepoints that's tricky!)
63 lines
1.2 KiB
Fish
63 lines
1.2 KiB
Fish
# 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
|
|
false
|
|
eval true
|
|
echo $status
|
|
# CHECK: 0
|
|
false
|
|
eval false
|
|
echo $status
|
|
# CHECK: 1
|
|
|
|
# Test return status in case of parsing error
|
|
false
|
|
eval "("
|
|
echo $status
|
|
# CHECK: 123
|
|
# CHECKERR: {{.*}}checks/eval.fish (line {{\d+}}): Unexpected end of string, expecting ')'
|
|
# CHECKERR: (
|
|
# CHECKERR: ^
|
|
false
|
|
eval '""'
|
|
echo $status
|
|
# CHECK: 123
|
|
# CHECKERR: {{.*}}checks/eval.fish (line {{\d+}}): The expanded command was empty.
|
|
# CHECKERR: ""
|
|
# CHECKERR: ^
|
|
|
|
function empty
|
|
end
|
|
|
|
# Regression tests for issue #5692
|
|
false
|
|
eval
|
|
echo blank eval: $status # 0
|
|
# CHECK: blank eval: 0
|
|
|
|
false
|
|
eval ""
|
|
echo empty arg eval: $status # 0
|
|
# CHECK: empty arg eval: 0
|
|
|
|
false
|
|
eval empty
|
|
echo empty function eval $status # 0
|
|
# CHECK: empty function eval 0
|
|
|
|
false
|
|
eval "begin; end;"
|
|
echo empty block eval: $status # 0
|
|
# CHECK: empty block eval: 0
|
|
|
|
source /banana/\t/foo
|
|
# CHECKERR: source: Error encountered while sourcing file '/banana/\t/foo':
|
|
# CHECKERR: source: No such file or directory
|