summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorSebastien Chapuis <sebastien@chapu.is>2018-01-06 00:39:47 +0100
committerSebastien Chapuis <sebastien@chapu.is>2018-01-09 13:20:55 +0100
commit216faf2a7372a252a7e2190c9a7474dcab71e93a (patch)
treef768e33393c08cf535cf65482377656230618445 /rust-mode-tests.el
parent27911c88b0d32b66429d61bb056ecf1b10e66598 (diff)
downloadrust-mode-216faf2a7372a252a7e2190c9a7474dcab71e93a.tar.gz
Do not indent where clause by default (follow standard) #257
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el33
1 files changed, 20 insertions, 13 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index b2e8338..6c6e9af 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -451,7 +451,8 @@ fn foo4(a:i32,
"))
(ert-deftest indent-body-after-where ()
- (test-indent
+ (let ((rust-indent-where-clause t))
+ (test-indent
"
fn foo1(a: A, b: B) -> A
where A: Clone + Default, B: Eq {
@@ -469,10 +470,11 @@ fn foo2(a: A, b: B) -> A
bar: 3
}
}
-"))
+")))
(ert-deftest indent-align-where-clauses-style1a ()
- (test-indent
+ (let ((rust-indent-where-clause t))
+ (test-indent
"
fn foo1a(a: A, b: B, c: C) -> D
where A: Clone + Default,
@@ -484,10 +486,11 @@ fn foo1a(a: A, b: B, c: C) -> D
bar: 3
}
}
-"))
+")))
(ert-deftest indent-align-where-clauses-style1b ()
- (test-indent
+ (let ((rust-indent-where-clause t))
+ (test-indent
"
fn foo1b(a: A, b: B, c: C) -> D
where A: Clone + Default,
@@ -500,7 +503,7 @@ fn foo1b(a: A, b: B, c: C) -> D
bar: 3
}
}
-"))
+")))
(ert-deftest indent-align-where-clauses-style2a ()
(test-indent
@@ -596,7 +599,8 @@ where A: Clone + Default,
")))
(ert-deftest indent-align-where-clauses-impl-example ()
- (test-indent
+ (let ((rust-indent-where-clause t))
+ (test-indent
"
impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, V, S>
where K: Eq + Hash + Borrow<Q>,
@@ -608,10 +612,11 @@ impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, V, S>
bar: 3
}
}
-"))
+")))
(ert-deftest indent-align-where-clauses-first-line ()
- (test-indent
+ (let ((rust-indent-where-clause t))
+ (test-indent
"fn foo1(a: A, b: B) -> A
where A: Clone + Default, B: Eq {
let body;
@@ -619,7 +624,7 @@ impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, V, S>
bar: 3
}
}
-"))
+")))
(ert-deftest indent-align-where-in-comment1 ()
(test-indent
@@ -632,7 +637,8 @@ pub struct Region { // <-- this should be flush with left margin!
"))
(ert-deftest indent-align-where-in-comment2 ()
- (test-indent
+ (let ((rust-indent-where-clause t))
+ (test-indent
"fn foo<F,G>(f:F, g:G)
where F:Send,
// where
@@ -640,9 +646,10 @@ pub struct Region { // <-- this should be flush with left margin!
{
let body;
}
-"))
+")))
(ert-deftest indent-align-where-in-comment3 ()
+ (let ((rust-indent-where-clause t))
(test-indent
"fn foo<F,G>(f:F, g:G)
where F:Send,
@@ -651,7 +658,7 @@ pub struct Region { // <-- this should be flush with left margin!
{
let body;
}
-"))
+")))
(ert-deftest indent-square-bracket-alignment ()
(test-indent