summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorKonstantin Kharlamov <Hi-Angel@users.noreply.github.com>2019-10-01 01:41:36 +0300
committerNathan Moreau <nathan.moreau@m4x.org>2019-10-01 00:41:36 +0200
commit897af2444c0f7d8e7059632977402022c9b00ed9 (patch)
tree60d3bfc7f3081ca5e9f6a09b31d38e92015535f1 /rust-mode-tests.el
parent836a8a978e13547153ac18cfdc45b503de41030d (diff)
downloadrust-mode-897af2444c0f7d8e7059632977402022c9b00ed9.tar.gz
rust-mode.el: check for possible space between variable name and type (#325)
Fixes the following problem: consider code fn foo(a: u32, b : u32) {} Here, `b` was not highlighted as a variable, because the regex didn't take into account possible space before the colon. Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index b13c1ba..0c1ad1d 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -3108,6 +3108,16 @@ impl Two<'a> {
'(("Impl" "One" "Two")
("Fn" "one" "two"))))
+(ert-deftest font-lock-function-parameters ()
+ (rust-test-font-lock
+ "fn foo(a: u32, b : u32) {}"
+ '("fn" font-lock-keyword-face
+ "foo" font-lock-function-name-face
+ "a" font-lock-variable-name-face
+ "u32" font-lock-type-face
+ "b" font-lock-variable-name-face
+ "u32" font-lock-type-face)))
+
(when (executable-find rust-cargo-bin)
(ert-deftest rust-test-project-located ()
(lexical-let* ((test-dir (expand-file-name "test-project" default-directory))