branch: elpa/rust-mode
commit 3995d330acd33f07a983df494f4515e8edf5fd80
Author: Felix S. Klock II <[email protected]>
Commit: Felix S. Klock II <[email protected]>
Add regression test for PR #52.
Thanks again to @GBGamer !
---
rust-mode-tests.el | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index b94f041..bb40781 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -394,6 +394,32 @@ fn baz( a:int, // should work with a comment here
{ }
"))
+(ert-deftest indent-open-after-arrow ()
+ (test-indent
+ "
+// Indent function body only one level after `-> {`
+fn foo1(a:int, b:char) -> int {
+ let body;
+}
+
+fn foo2(a:int,
+ b:char) -> int {
+ let body;
+}
+
+fn foo3(a:int,
+ b:char)
+ -> int {
+ let body;
+}
+
+fn foo4(a:int,
+ b:char)
+ -> int where int:A {
+ let body;
+}
+"))
+
(ert-deftest indent-square-bracket-alignment ()
(test-indent
"