From 766bd8279b18bcbf6af0b8fea370c85414e407c4 Mon Sep 17 00:00:00 2001 From: Micah Chalmer Date: Mon, 23 Feb 2015 20:21:49 -0500 Subject: Parse '\\' and '\"' as char literals --- rust-mode-tests.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'rust-mode-tests.el') diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 007d116..3510d69 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -927,6 +927,22 @@ list of substrings of `STR' each followed by its face." "let" font-lock-keyword-face "'\\''" font-lock-string-face))) +(ert-deftest font-lock-escaped-double-quote-character-literal () + (rust-test-font-lock + "fn main() { let ch = '\\\"'; }" + '("fn" font-lock-keyword-face + "main" font-lock-function-name-face + "let" font-lock-keyword-face + "'\\\"'" font-lock-string-face))) + +(ert-deftest font-lock-escaped-backslash-character-literal () + (rust-test-font-lock + "fn main() { let ch = '\\\\'; }" + '("fn" font-lock-keyword-face + "main" font-lock-function-name-face + "let" font-lock-keyword-face + "'\\\\'" font-lock-string-face))) + (ert-deftest font-lock-raw-strings-no-hashes () (rust-test-font-lock "r\"No hashes\";" -- cgit v1.2.3