mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 14:40:37 +08:00
9367d4ff71
This does not include checks/function.fish because that currently includes a "; end" in a message that indent would remove, breaking the test.
51 lines
937 B
Fish
51 lines
937 B
Fish
#RUN: %fish %s
|
|
|
|
echo x-{1}
|
|
#CHECK: x-{1}
|
|
|
|
echo x-{1,2}
|
|
#CHECK: x-1 x-2
|
|
|
|
echo foo-{1,2{3,4}}
|
|
#CHECK: foo-1 foo-23 foo-24
|
|
|
|
echo foo-{} # literal "{}" expands to itself
|
|
#CHECK: foo-{}
|
|
|
|
echo foo-{{},{}} # the inner "{}" expand to themselves, the outer pair expands normally.
|
|
#CHECK: foo-{} foo-{}
|
|
|
|
echo foo-{{a},{}} # also works with something in the braces.
|
|
#CHECK: foo-{a} foo-{}
|
|
|
|
echo foo-{""} # still expands to foo-{}
|
|
#CHECK: foo-{}
|
|
|
|
echo foo-{$undefinedvar} # still expands to nothing
|
|
#CHECK:
|
|
|
|
echo foo-{,,,} # four empty items in the braces.
|
|
#CHECK: foo- foo- foo- foo-
|
|
|
|
echo foo-{,\,,} # an empty item, a "," and an empty item.
|
|
#CHECK: foo- foo-, foo-
|
|
|
|
echo .{ foo bar }. # see 6564
|
|
#CHECK: .{ foo bar }.
|
|
|
|
# whitespace within entries is retained
|
|
for foo in {a, hello
|
|
wo rld }
|
|
echo \'$foo\'
|
|
end
|
|
# CHECK: 'a'
|
|
# CHECK: 'hello
|
|
# CHECK: wo rld'
|
|
|
|
for foo in {hello
|
|
world}
|
|
echo \'$foo\'
|
|
end
|
|
#CHECK: '{hello
|
|
#CHECK: world}'
|