summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorMicah Chalmer <micah@micahchalmer.net>2015-07-07 23:13:01 -0400
committerMicah Chalmer <micah@micahchalmer.net>2015-07-07 23:13:01 -0400
commit88ff62ad3181d9976c9f435efa614b422037af51 (patch)
tree9051c90a56e89757f3543046563ee53060d2144c /rust-mode-tests.el
parent102ad5f5a53e6147e21e7737b861808874b1a04b (diff)
downloadrust-mode-88ff62ad3181d9976c9f435efa614b422037af51.tar.gz
Remove unnecessary code with call to undefined function
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 4a6cf20..5312f38 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -2168,6 +2168,35 @@ type Foo<T> where T: Copy = Box<T>;
'((10 11))
'(7 9))))
+
+(ert-deftest font-lock-extend-region-in-string ()
+
+ (with-temp-buffer
+ (rust-mode)
+ (insert "
+fn foo() {
+ let x = r\"
+Fontification needs to include this whole string or none of it.
+ \"
+}")
+ (font-lock-fontify-buffer)
+ (let ((font-lock-beg 13)
+ (font-lock-end 42))
+ (rust-font-lock-extend-region)
+ (should (<= font-lock-beg 13))
+ (should (>= font-lock-end 106))
+ )
+ (let ((font-lock-beg 42)
+ (font-lock-end 108))
+ (rust-font-lock-extend-region)
+ (should (<= font-lock-beg 25))
+ (should (>= font-lock-end 108)))
+ (let ((font-lock-beg 1)
+ (font-lock-end 12))
+ (rust-font-lock-extend-region)
+ (should (<= font-lock-beg 1))
+ (should (>= font-lock-end 12)))))
+
;; If electric-pair-mode is available, load it and run the tests that use it. If not,
;; no error--the tests will be skipped.
(require 'elec-pair nil t)