branch: elpa/rust-mode
commit 52febe93a0b15740a3891855701555af404953ba
Author: Micah Chalmer <[email protected]>
Commit: Micah Chalmer <[email protected]>
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\""))