From 53c558cf7241cbeca93f18e04a81a25ef8675313 Mon Sep 17 00:00:00 2001 From: Micah Chalmer Date: Mon, 8 Jun 2015 02:04:05 -0400 Subject: 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. --- rust-mode-tests.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'rust-mode-tests.el') 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 " -- cgit v1.2.3