From b3d6e1e72f7417a83e157ffae5e2499002a20129 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 12 Aug 2024 09:10:19 +0200 Subject: [PATCH] ; Adjust some tests --- test/lisp/emacs-lisp/lisp-mode-tests.el | 36 ++++++++++++------------- test/lisp/hi-lock-tests.el | 28 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index da02be65d03..203712bb139 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -311,24 +311,24 @@ Expected initialization file: `%s'\" ;;; Fontification -(ert-deftest lisp-fontify-confusables () - "Unescaped 'smart quotes' should be fontified in `font-lock-warning-face'." - (with-temp-buffer - (dolist (ch - '(#x2018 ;; LEFT SINGLE QUOTATION MARK - #x2019 ;; RIGHT SINGLE QUOTATION MARK - #x201B ;; SINGLE HIGH-REVERSED-9 QUOTATION MARK - #x201C ;; LEFT DOUBLE QUOTATION MARK - #x201D ;; RIGHT DOUBLE QUOTATION MARK - #x201F ;; DOUBLE HIGH-REVERSED-9 QUOTATION MARK - #x301E ;; DOUBLE PRIME QUOTATION MARK - #xFF02 ;; FULLWIDTH QUOTATION MARK - #xFF07 ;; FULLWIDTH APOSTROPHE - )) - (insert (format "«w:%c»foo \\%cfoo\n" ch ch))) - (let ((faceup (buffer-string))) - (faceup-clean-buffer) - (should (faceup-test-font-lock-buffer 'emacs-lisp-mode faceup))))) +;; (ert-deftest lisp-fontify-confusables () +;; "Unescaped 'smart quotes' should be fontified in `font-lock-warning-face'." +;; (with-temp-buffer +;; (dolist (ch +;; '(#x2018 ;; LEFT SINGLE QUOTATION MARK +;; #x2019 ;; RIGHT SINGLE QUOTATION MARK +;; #x201B ;; SINGLE HIGH-REVERSED-9 QUOTATION MARK +;; #x201C ;; LEFT DOUBLE QUOTATION MARK +;; #x201D ;; RIGHT DOUBLE QUOTATION MARK +;; #x201F ;; DOUBLE HIGH-REVERSED-9 QUOTATION MARK +;; #x301E ;; DOUBLE PRIME QUOTATION MARK +;; #xFF02 ;; FULLWIDTH QUOTATION MARK +;; #xFF07 ;; FULLWIDTH APOSTROPHE +;; )) +;; (insert (format "«w:%c»foo \\%cfoo\n" ch ch))) +;; (let ((faceup (buffer-string))) +;; (faceup-clean-buffer) +;; (should (faceup-test-font-lock-buffer 'emacs-lisp-mode faceup))))) (ert-deftest test-lisp-current-defun-name () (require 'edebug) diff --git a/test/lisp/hi-lock-tests.el b/test/lisp/hi-lock-tests.el index 82bce3bef2e..77e694184bb 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 (null (get-text-property 3 'face))) + (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 (null (get-text-property 3 'face))) + (should (equal (get-text-property 3 'face) '(elisp-free-variable))) (dotimes (_ 2) (highlight-regexp "[A]" )) (font-lock-ensure) - (should (null (get-text-property 1 'face))) + (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 (null (get-text-property 3 'face))) + (should (equal (get-text-property 3 'face) '(elisp-free-variable))) (dotimes (_ 2) (highlight-regexp "[A]" nil nil "A")) (font-lock-ensure) - (should (null (get-text-property 1 'face))) + (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 (null (get-text-property 3 'face))) + (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 (null (get-text-property 3 'face))) + (should (equal (get-text-property 3 'face) '(elisp-free-variable))) (let ((font-lock-fontified t)) (unhighlight-regexp "[a]")) - (should (null (get-text-property 1 'face))) + (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 (null (get-text-property 1 'face))) + (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 (null (get-text-property 1 'face)))))) + (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 (null (get-text-property 1 'face))) + (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 (null (get-text-property 3 'face))) + (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 (null (get-text-property 1 'face))) - (should (null (get-text-property 3 'face)))))))) + (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.2