summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-10-25 10:42:56 -0700
committerGitHub <noreply@github.com>2016-10-25 10:42:56 -0700
commit01ac5d8197658c21412acde16df7c39325f03e4d (patch)
tree7034ebfe8cd8ab84275bc33288b8bb93c9325d71 /rust-mode-tests.el
parent1587839ba493b5ab98fb8415338172a9a22f224b (diff)
parentfba77143c009b7b11839c77259f3b1f7a9c88bb8 (diff)
downloadrust-mode-01ac5d8197658c21412acde16df7c39325f03e4d.tar.gz
Merge pull request #177 from mrBliss/handle-comments-method-chains
Handle comments when indenting method chains
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 35a1cbd..2585237 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -1599,6 +1599,19 @@ fn main() {
"
)))
+(ert-deftest indent-method-chains-look-over-comment ()
+ (let ((rust-indent-method-chain t)) (test-indent
+ "
+fn main() {
+ thing.a.do_it
+ // A comment
+ .aligned
+ // Another comment
+ .more_alignment();
+}
+"
+ )))
+
(ert-deftest indent-method-chains-comment ()
(let ((rust-indent-method-chain t)) (test-indent
"
@@ -1627,6 +1640,17 @@ fn main() { // comment here should not push next line out
"
)))
+(ert-deftest indent-method-chains-after-comment2 ()
+ (let ((rust-indent-method-chain t)) (test-indent
+ "
+fn main() {
+ // Lorem ipsum lorem ipsum lorem ipsum lorem.ipsum
+ foo.bar()
+}
+"
+ )))
+
+
(ert-deftest test-for-issue-36-syntax-corrupted-state ()
"This is a test for a issue #36, which involved emacs's
internal state getting corrupted when actions were done in a