summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el26
1 files changed, 26 insertions, 0 deletions
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
"