diff options
| author | Christophe Troestler <Christophe.Troestler@umons.ac.be> | 2022-01-19 10:44:15 +0100 |
|---|---|---|
| committer | Christophe Troestler <Christophe.Troestler@umons.ac.be> | 2022-01-30 14:24:17 +0100 |
| commit | 32718d4b166e9ee439e2b15b5e4d8e4fa783a4c5 (patch) | |
| tree | d6a10df29ce35846602a1d34a9b3239995a227f7 /rust-mode-tests.el | |
| parent | 2da2e7f08a83fbec381c8604d3e00c4ee2c02855 (diff) | |
| download | rust-mode-32718d4b166e9ee439e2b15b5e4d8e4fa783a4c5.tar.gz | |
Highlight the (optional) type suffix of numbers with the type face
Diffstat (limited to 'rust-mode-tests.el')
| -rw-r--r-- | rust-mode-tests.el | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 0d9f06b..8e3ee45 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1304,6 +1304,56 @@ list of substrings of `STR' each followed by its face." '("/* " font-lock-comment-delimiter-face "#[foo] */" font-lock-comment-face))) +(ert-deftest font-lock-number-with-type () + (rust-test-font-lock + "-123i32" + '("i32" font-lock-type-face)) + (rust-test-font-lock + "123u32" + '("u32" font-lock-type-face)) + (rust-test-font-lock + "123_123_u32" + '("u32" font-lock-type-face)) + (rust-test-font-lock + "0xff_u8" + '("u8" font-lock-type-face)) + (rust-test-font-lock + "0b1111_1111_1001_0000i64" + '("i64" font-lock-type-face)) + (rust-test-font-lock + "0usize" + '("usize" font-lock-type-face)) + (rust-test-font-lock + "123.0f64 + 1." + '("f64" font-lock-type-face)) + (rust-test-font-lock + "0.1f32" + '("f32" font-lock-type-face)) + (rust-test-font-lock + "12E+99_f64" + '("f64" font-lock-type-face)) + (rust-test-font-lock + "5f32" + '("f32" font-lock-type-face)) + (rust-test-font-lock + "0x5i32" + '("i32" font-lock-type-face)) + (rust-test-font-lock + "1x5i32" + '()) + (rust-test-font-lock + "0x5i321" + '()) + (rust-test-font-lock + "fname5f32" + '()) + (rust-test-font-lock + "0x5i32+1" + '("i32" font-lock-type-face)) + (rust-test-font-lock + "f(0xFFi32)" + '("i32" font-lock-type-face))) + (ert-deftest font-lock-double-quote-character-literal () (rust-test-font-lock "'\"'; let" |
