2014-12-23 23:46:47 +00:00
|
|
|
echo Test1
|
|
|
|
echo -n '
|
|
|
|
begin
|
|
|
|
echo hi
|
|
|
|
|
|
|
|
|
|
|
|
end | cat | cat | begin ; echo hi ; end | begin ; begin ; echo hi ; end ; end arg
|
2014-12-23 23:51:18 +00:00
|
|
|
' | ../fish_indent
|
2014-12-23 23:46:47 +00:00
|
|
|
|
|
|
|
echo \nTest2
|
|
|
|
echo -n '
|
|
|
|
switch aloha
|
|
|
|
|
|
|
|
case alpha
|
|
|
|
echo sup
|
|
|
|
|
|
|
|
case beta gamma
|
|
|
|
echo hi
|
|
|
|
|
|
|
|
end
|
2014-12-23 23:51:18 +00:00
|
|
|
' | ../fish_indent
|
2014-12-23 23:46:47 +00:00
|
|
|
|
|
|
|
echo \nTest3
|
|
|
|
echo -n '
|
|
|
|
function hello_world
|
|
|
|
|
|
|
|
'begin'
|
|
|
|
echo hi
|
|
|
|
end | cat
|
|
|
|
|
|
|
|
echo sup; echo sup
|
|
|
|
echo hello;
|
|
|
|
|
|
|
|
echo hello
|
|
|
|
end
|
2014-12-23 23:51:18 +00:00
|
|
|
' | ../fish_indent
|
2014-12-23 23:46:47 +00:00
|
|
|
|
|
|
|
echo \nTest4
|
|
|
|
echo -n '
|
|
|
|
echo alpha #comment1
|
|
|
|
#comment2
|
|
|
|
|
|
|
|
#comment3
|
|
|
|
for i in abc #comment1
|
|
|
|
#comment2
|
|
|
|
echo hi
|
|
|
|
end
|
|
|
|
|
|
|
|
switch foo #abc
|
|
|
|
# bar
|
|
|
|
case bar
|
|
|
|
echo baz\
|
|
|
|
qqq
|
|
|
|
case "*"
|
|
|
|
echo sup
|
2014-12-23 23:51:18 +00:00
|
|
|
end' | ../fish_indent
|
2014-12-23 23:46:47 +00:00
|
|
|
|
|
|
|
echo \nTest5
|
|
|
|
echo -n '
|
|
|
|
if true
|
|
|
|
else if false
|
|
|
|
echo alpha
|
|
|
|
switch beta
|
|
|
|
case gamma
|
|
|
|
echo delta
|
|
|
|
end
|
|
|
|
end
|
2014-12-23 23:51:18 +00:00
|
|
|
' | ../fish_indent -i
|
2014-12-23 23:46:47 +00:00
|
|
|
|
|
|
|
echo \nTest6
|
|
|
|
# Test errors
|
|
|
|
echo -n '
|
|
|
|
begin
|
|
|
|
echo hi
|
|
|
|
else
|
|
|
|
echo bye
|
|
|
|
end; echo alpha "
|
2014-12-24 00:30:39 +00:00
|
|
|
' | ../fish_indent
|
|
|
|
|
|
|
|
echo \nTest7
|
|
|
|
# issue 1665
|
|
|
|
echo -n '
|
|
|
|
if begin ; false; end; echo hi ; end
|
|
|
|
while begin ; false; end; echo hi ; end
|
|
|
|
' | ../fish_indent
|