emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode 52febe9 137/486: Add a few more tests for indent


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 52febe9 137/486: Add a few more tests for indents inside strings
Date: Sat, 7 Aug 2021 09:25:05 -0400 (EDT)

branch: elpa/rust-mode
commit 52febe93a0b15740a3891855701555af404953ba
Author: Micah Chalmer <micah@micahchalmer.net>
Commit: Micah Chalmer <micah@micahchalmer.net>

    Add a few more tests for indents inside strings
---
 rust-mode-tests.el | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 310eeaf..007d116 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -1290,3 +1290,39 @@ And another line not indented
 \")
 }
 "))
+
+(ert-deftest test-indent-string-eol-backslash-dont-touch-raw-strings ()
+  (test-indent
+   "
+pub fn foo() {
+    format!(r\"\
+abc\
+         def\");
+}
+
+pub fn foo() {
+    format!(r\"la la la
+    la\
+la la\");
+}
+"
+   ;; Should still indent the code parts but leave the string internals alone:
+   "
+    pub fn foo() {
+    format!(r\"\
+abc\
+         def\");
+}
+
+pub fn foo() {
+          format!(r\"la la la
+    la\
+la la\");
+}
+"
+   ))
+
+(ert-deftest indent-inside-string-first-line ()
+  (test-indent
+   ;; Needs to leave 1 space before "world"
+   "\"hello \\\n world\""))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]