diff options
| author | Georg Brandl <georg@python.org> | 2016-02-25 08:25:01 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2016-02-25 08:25:01 +0100 |
| commit | 01db4cb55b43300375d21aaa7a99b682e53e915a (patch) | |
| tree | ec2eff110cbbba1d92e56a0bc97e32125022855d /rust-mode-tests.el | |
| parent | 00e5366f70d4627db82170f736712861ed8de976 (diff) | |
| download | rust-mode-01db4cb55b43300375d21aaa7a99b682e53e915a.tar.gz | |
Fix font-locking for Unicode escapes in character literals.
* There is only \u, no \U
* \u requires braces, but allows 1-6 hex digits
Diffstat (limited to 'rust-mode-tests.el')
| -rw-r--r-- | rust-mode-tests.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 8390ab6..a99d36b 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1217,6 +1217,18 @@ list of substrings of `STR' each followed by its face." "let" font-lock-keyword-face "'\\\\'" font-lock-string-face))) +(ert-deftest font-lock-hex-escape-character-literal () + (rust-test-font-lock + "let ch = '\\x1f';" + '("let" font-lock-keyword-face + "'\\x1f'" font-lock-string-face))) + +(ert-deftest font-lock-unicode-escape-character-literal () + (rust-test-font-lock + "let ch = '\\u{1ffff}';" + '("let" font-lock-keyword-face + "'\\u{1ffff}'" font-lock-string-face))) + (ert-deftest font-lock-raw-strings-no-hashes () (rust-test-font-lock "r\"No hashes\";" |
