From bcee2e409813746ec5e1f77a4c7dba0b381e7644 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 21 Aug 2024 12:21:59 +0200 Subject: [PATCH] ; Adjust some tests --- test/lisp/emacs-lisp/scope-tests.el | 31 ++++++++++++++++++++++++----- test/lisp/hi-lock-tests.el | 28 +++++++++++++------------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/test/lisp/emacs-lisp/scope-tests.el b/test/lisp/emacs-lisp/scope-tests.el index cc2623aadbe..4258c3f8b4d 100644 --- a/test/lisp/emacs-lisp/scope-tests.el +++ b/test/lisp/emacs-lisp/scope-tests.el @@ -36,12 +36,16 @@ (baz baz)) (when (and bar spam baz) (ignore bar baz))) - (ignore baz))" '((13 3 13) + (ignore baz))" '((2 5 nil) + (13 3 13) (17 3 17) + (25 4 nil) (32 3 32) (36 3 17) (51 3 51) (55 3 32) + (66 4 nil) + (72 3 nil) (76 3 13) (80 4 nil) (85 3 51) @@ -63,15 +67,21 @@ (`(,be . ,ops) (dolist (op ops) (push be (alist-get op op-be-alist))))))) - op-be-alist))" '((110 11 110) + op-be-alist))" '((2 5 nil) + (104 3 nil) + (110 11 110) (133 16 nil) + (189 6 nil) (197 6 197) + (221 5 nil) (228 7 nil) (236 6 197) (257 2 257) (263 3 263) + (279 6 nil) (290 3 263) (287 2 287) + (308 4 nil) (313 2 257) (317 9 nil) (327 2 287) @@ -88,8 +98,10 @@ `(let (,syms ,vals) (pcase-dolist (`(,k . ,v) ,env) (push k ,syms) (push v ,vals)) (cl-progv ,syms ,vals - ,@body))))" '((45 3 45) + ,@body))))" '((2 8 nil) + (45 3 45) (55 4 55) + (130 3 nil) (136 4 136) (142 11 nil) (172 4 172) @@ -109,20 +121,29 @@ (cl-flet ((foo (bar) (* bar foo))) (cl-block foo (while (foo foo) (cl-return-from foo (foo foo))))))" - '((8 3 8) + '((2 3 nil) + (8 3 8) + (19 7 nil) (29 3 29) (34 3 34) (40 1 nil) (42 3 34) (46 3 8) + (58 8 nil) (67 3 67) + (78 5 nil) (85 3 29) (89 3 8) + (95 14 nil) (110 3 67) (115 3 29) (119 3 8)))) (ert-deftest scope-test-5 () - (scope-test "(cl-loop if 1 return (+ it it))" '((22 1 nil) (24 2 9) (27 2 9)))) + (scope-test "(cl-loop if 1 return (+ it it))" + '((1 7 nil) + (22 1 nil) + (24 2 9) + (27 2 9)))) ;;; scope-tests.el ends here diff --git a/test/lisp/hi-lock-tests.el b/test/lisp/hi-lock-tests.el index 77e694184bb..6cfe8b66062 100644 --- a/test/lisp/hi-lock-tests.el +++ b/test/lisp/hi-lock-tests.el @@ -108,41 +108,41 @@ (should (memq 'hi-yellow (get-text-property 1 'face))) (should (memq 'hi-yellow (get-text-property 3 'face))) (let ((font-lock-fontified t)) (unhighlight-regexp "[a]")) - (should (equal (get-text-property 3 'face) '(elisp-free-variable))) + (should (equal (get-text-property 3 'face) 'elisp-free-variable)) (dotimes (_ 2) (highlight-regexp "[a]" nil nil "a")) (font-lock-ensure) (should (memq 'hi-yellow (get-text-property 1 'face))) (should (memq 'hi-yellow (get-text-property 3 'face))) (let ((font-lock-fontified t)) (unhighlight-regexp "a")) - (should (equal (get-text-property 3 'face) '(elisp-free-variable))) + (should (equal (get-text-property 3 'face) 'elisp-free-variable)) (dotimes (_ 2) (highlight-regexp "[A]" )) (font-lock-ensure) - (should (equal (get-text-property 1 'face) '(elisp-free-variable))) + (should (equal (get-text-property 1 'face) 'elisp-free-variable)) (should (memq 'hi-yellow (get-text-property 3 'face))) (let ((font-lock-fontified t)) (unhighlight-regexp "[A]")) - (should (equal (get-text-property 3 'face) '(elisp-free-variable))) + (should (equal (get-text-property 3 'face) 'elisp-free-variable)) (dotimes (_ 2) (highlight-regexp "[A]" nil nil "A")) (font-lock-ensure) - (should (equal (get-text-property 1 'face) '(elisp-free-variable))) + (should (equal (get-text-property 1 'face) 'elisp-free-variable)) (should (memq 'hi-yellow (get-text-property 3 'face))) (let ((font-lock-fontified t)) (unhighlight-regexp "A")) - (should (equal (get-text-property 3 'face) '(elisp-free-variable))) + (should (equal (get-text-property 3 'face) 'elisp-free-variable)) (let ((case-fold-search nil)) (dotimes (_ 2) (highlight-regexp "[a]"))) (font-lock-ensure) (should (memq 'hi-yellow (get-text-property 1 'face))) - (should (equal (get-text-property 3 'face) '(elisp-free-variable))) + (should (equal (get-text-property 3 'face) 'elisp-free-variable)) (let ((font-lock-fontified t)) (unhighlight-regexp "[a]")) - (should (equal (get-text-property 1 'face) '(elisp-free-variable))) + (should (equal (get-text-property 1 'face) 'elisp-free-variable)) (dotimes (_ 2) (highlight-phrase "a a")) (font-lock-ensure) (should (memq 'hi-yellow (get-text-property 1 'face))) (let ((font-lock-fontified t)) (unhighlight-regexp "a a")) - (should (equal (get-text-property 1 'face) '(elisp-free-variable))) + (should (equal (get-text-property 1 'face) 'elisp-free-variable)) (let ((search-spaces-regexp search-whitespace-regexp)) (highlight-regexp "a a")) (font-lock-ensure) @@ -157,7 +157,7 @@ (car defaults))) (font-lock-fontified t)) (call-interactively 'unhighlight-regexp))) - (should (equal (get-text-property 1 'face) '(elisp-free-variable)))))) + (should (equal (get-text-property 1 'face) 'elisp-free-variable))))) (ert-deftest hi-lock-unhighlight () "Test for unhighlighting and `hi-lock--regexps-at-point'." @@ -206,12 +206,12 @@ (goto-char 1) (let ((font-lock-fontified t)) (call-interactively 'unhighlight-regexp)) - (should (equal (get-text-property 1 'face) '(elisp-free-variable))) + (should (equal (get-text-property 1 'face) 'elisp-free-variable)) (should (memq 'hi-yellow (get-text-property 3 'face))) ;; Next call should unhighlight remaining regepxs (let ((font-lock-fontified t)) (call-interactively 'unhighlight-regexp)) - (should (equal (get-text-property 3 'face) '(elisp-free-variable))) + (should (equal (get-text-property 3 'face) 'elisp-free-variable)) ;; Test unhighlight all (highlight-regexp "a") @@ -221,8 +221,8 @@ (should (memq 'hi-yellow (get-text-property 3 'face))) (let ((font-lock-fontified t)) (unhighlight-regexp t)) - (should (equal (get-text-property 1 'face) '(elisp-free-variable))) - (should (equal (get-text-property 3 'face) '(elisp-free-variable)))))))) + (should (equal (get-text-property 1 'face) 'elisp-free-variable)) + (should (equal (get-text-property 3 'face) 'elisp-free-variable))))))) (provide 'hi-lock-tests) ;;; hi-lock-tests.el ends here -- 2.39.5