diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-12-23 15:46:47 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-12-23 15:46:47 -0800 |
commit | da2e2c2e993313c4cebec1d860c4567894299fee (patch) | |
tree | 3f98d3f0d22fb1222a35aea0a9688216152dd83e | |
parent | 8ba0ab2172ae81432ed4db9a377169857bd2d326 (diff) |
Implement tests for fish_indent
-rw-r--r-- | tests/indent.err | 0 | ||||
-rw-r--r-- | tests/indent.in | 78 | ||||
-rw-r--r-- | tests/indent.out | 80 | ||||
-rw-r--r-- | tests/indent.status | 1 |
4 files changed, 159 insertions, 0 deletions
diff --git a/tests/indent.err b/tests/indent.err new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/indent.err 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 diff --git a/tests/indent.out b/tests/indent.out new file mode 100644 index 00000000..cd13ba88 --- /dev/null +++ b/tests/indent.out @@ -0,0 +1,80 @@ +Test1 + +begin + echo hi + + +end | cat | cat | begin + echo hi +end | begin + begin + echo hi + end +end arg + +Test2 + +switch aloha + + case alpha + echo sup + + case beta gamma + echo hi + +end + +Test3 + +function hello_world + + begin + echo hi + end | cat + + echo sup + echo sup + echo hello + + + echo hello +end + +Test4 + +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 +Test5 + +if true +else if false +echo alpha +switch beta +case gamma +echo delta +end +end + +Test6 + +begin + echo hi +else +echo bye +end +echo alpha " diff --git a/tests/indent.status b/tests/indent.status new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/tests/indent.status @@ -0,0 +1 @@ +0 |