summaryrefslogtreecommitdiff
path: root/rust-mode-tests.el
diff options
context:
space:
mode:
authorMicah Chalmer <micah@micahchalmer.net>2015-02-03 01:39:23 -0500
committerMicah Chalmer <micah@micahchalmer.net>2015-02-03 22:10:09 -0500
commit8a69f69b150f4f38d7d0a1a93d78c50648b5de8f (patch)
tree91acf0fabc2c6c3f3e85a8b1d791d50efd1d8930 /rust-mode-tests.el
parent04e4b49de75540b400265f47e02ef35a52d96a70 (diff)
downloadrust-mode-8a69f69b150f4f38d7d0a1a93d78c50648b5de8f.tar.gz
Use old code style for emacs 23 compat
The new recommended style is to use the "cl-" prefixed versions, but they do not exist in emacs 23. We still want to stay compatible with that, so use plain "loop" rather than "cl-loop" to allow the tests to work with both old and new versions. ALso "pcase" was introduced in emacs 24, so stop using it to remain compatible with emacs 23.
Diffstat (limited to 'rust-mode-tests.el')
-rw-r--r--rust-mode-tests.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 54b4524..6aa3528 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -616,7 +616,10 @@ fn indented_already() {
POS-SYMBOL is a symbol found in `rust-test-positions-alist'.
Convert the line-column information from that list into a buffer position value."
(interactive "P")
- (pcase-let ((`(,line ,column) (cadr (assoc pos-symbol rust-test-positions-alist))))
+ (let* (
+ (line-and-column (cadr (assoc pos-symbol rust-test-positions-alist)))
+ (line (nth 0 line-and-column))
+ (column (nth 1 line-and-column)))
(save-excursion
(goto-line line)
(move-to-column column)
@@ -844,14 +847,14 @@ All positions are position symbols found in `rust-test-positions-alist'."
(defun rust-test-group-str-by-face (str)
"Fontify `STR' in rust-mode and group it by face, returning a
list of substrings of `STR' each followed by its face."
- (cl-loop with fontified = (rust-test-fontify-string str)
- for start = 0 then end
- while start
- for end = (next-single-property-change start 'face fontified)
- for prop = (get-text-property start 'face fontified)
- for text = (substring-no-properties fontified start end)
- if prop
- append (list text prop)))
+ (loop with fontified = (rust-test-fontify-string str)
+ for start = 0 then end
+ while start
+ for end = (next-single-property-change start 'face fontified)
+ for prop = (get-text-property start 'face fontified)
+ for text = (substring-no-properties fontified start end)
+ if prop
+ append (list text prop)))
(defun rust-test-font-lock (source face-groups)
"Test that `SOURCE' fontifies to the expected `FACE-GROUPS'"