summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorMicah Chalmer <micah@micahchalmer.net>2015-06-08 02:04:05 -0400
committerMicah Chalmer <micah@micahchalmer.net>2015-07-05 21:32:51 -0400
commit53c558cf7241cbeca93f18e04a81a25ef8675313 (patch)
tree9cb8f77123576a98c2a3d2bab37b0d392514b773 /rust-mode-tests.el
parentf1b6007ab5c9acb5c2b07452f5f38caf85ec537f (diff)
downloadrust-mode-53c558cf7241cbeca93f18e04a81a25ef8675313.tar.gz
Factor out rust-conditional-re-search-forward
Factor out the method of looking for a match for a regexp, but filtering out some of the matches with a filtering function. This will be used again for angle bracket filtering. This also fixes an issue with raw string handling.
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 58fcaaf..c7446d6 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -362,6 +362,29 @@ use foo::bar::baz;
fn foo() { }
"))
+(ert-deftest font-lock-multi-raw-strings-in-a-row ()
+ (rust-test-font-lock
+ "
+r\"foo\\\", \"bar\", r\"bar\";
+r\"foo\\.\", \"bar\", r\"bar\";
+r\"foo\\..\", \"bar\", r\"foo\\..\\bar\";
+r\"\\\", \"foo\", r\"\\foo\";
+not_a_string();
+
+"
+
+ (apply 'append (mapcar (lambda (s) (list s 'font-lock-string-face))
+ '("r\"foo\\\"" "\"bar\"" "r\"bar\""
+ "r\"foo\\.\"" "\"bar\"" "r\"bar\""
+ "r\"foo\\..\"" "\"bar\"" "r\"foo\\..\\bar\""
+ "r\"\\\"" "\"foo\"" "r\"\\foo\"")))
+ ))
+
+(ert-deftest font-lock-raw-string-after-normal-string-ending-in-r ()
+ (rust-test-font-lock
+ "\"bar\" r\"foo\""
+ '("\"bar\"" font-lock-string-face "r\"foo\"" font-lock-string-face)))
+
(ert-deftest indent-params-no-align ()
(test-indent
"