From da2e2c2e993313c4cebec1d860c4567894299fee Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 23 Dec 2014 15:46:47 -0800 Subject: Implement tests for fish_indent --- tests/indent.in | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tests/indent.in (limited to 'tests/indent.in') diff --git a/tests/indent.in b/tests/indent.in new file mode 100644 index 00000000..74bc04c1 --- /dev/null +++ b/tests/indent.in @@ -0,0 +1,78 @@ +echo Test1 +echo -n ' +begin +echo hi + + +end | cat | cat | begin ; echo hi ; end | begin ; begin ; echo hi ; end ; end arg +' | ../fish_prettify + +echo \nTest2 +echo -n ' +switch aloha + + case alpha + echo sup + + case beta gamma + echo hi + +end +' | ../fish_prettify + +echo \nTest3 +echo -n ' +function hello_world + + 'begin' + echo hi + end | cat + + echo sup; echo sup + echo hello; + + echo hello + end +' | ../fish_prettify + +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 +end' | ../fish_prettify + +echo \nTest5 +echo -n ' +if true +else if false + echo alpha +switch beta + case gamma + echo delta +end +end +' | ../fish_prettify -i + +echo \nTest6 +# Test errors +echo -n ' +begin +echo hi +else +echo bye +end; echo alpha " +' | ../fish_prettify \ No newline at end of file -- cgit v1.2.3