Skip to content

Commit 55e6cd9

Browse files
committed
Add test for word boundaries for string ending with r.
1 parent d432409 commit 55e6cd9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

rust-mode-tests.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,19 @@ fn g() {
14521452
"g" font-lock-function-name-face
14531453
"\"xs\"" font-lock-string-face)))
14541454

1455+
(ert-deftest font-lock-string-ending-with-r-word-boundary ()
1456+
(with-temp-buffer
1457+
(rust-mode)
1458+
(insert "const foo = \"foo bar\"")
1459+
(font-lock-fontify-buffer)
1460+
;; right-word should move the point to the end of the words.
1461+
(goto-char 14)
1462+
(right-word)
1463+
(should (equal 17 (point)))
1464+
(right-word)
1465+
(should (equal 21 (point)))
1466+
))
1467+
14551468
(ert-deftest font-lock-raw-string-trick-ending-followed-by-string-with-quote ()
14561469
(rust-test-font-lock
14571470
"r\"With what looks like the start of a raw string at the end r#\";

0 commit comments

Comments
 (0)