mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-06 03:40:56 -08:00
Add tests for text-property-search to check prop-match-value
* test/lisp/emacs-lisp/text-property-search-tests.el (with-match-test): New macro. (text-property-search-forward-prop-match-match-face-nil-nil) (text-property-search-forward-prop-match-match-face-bold-t) (text-property-search-forward-prop-match-match-face-bold-nil) (text-property-search-backward-prop-match-match-face-nil-nil) (text-property-search-backward-prop-match-match-face-italic-t) (text-property-search-backward-prop-match-match-face-italic-nil): Add test cases to also verify the value of prop-match-value (bug#36486).
This commit is contained in:
parent
3cb166ad26
commit
cfcaf06fe5
1 changed files with 43 additions and 0 deletions
|
|
@ -108,6 +108,49 @@
|
||||||
'("bold1")
|
'("bold1")
|
||||||
35))
|
35))
|
||||||
|
|
||||||
|
(defmacro with-match-test (form beginning end value &optional point)
|
||||||
|
`(with-temp-buffer
|
||||||
|
(text-property-setup)
|
||||||
|
(when ,point
|
||||||
|
(goto-char ,point))
|
||||||
|
(should (equal ,form
|
||||||
|
(make-prop-match :beginning ,beginning
|
||||||
|
:end ,end
|
||||||
|
:value ,value)))))
|
||||||
|
|
||||||
|
(ert-deftest text-property-search-forward-prop-match-match-face-nil-nil ()
|
||||||
|
(with-match-test
|
||||||
|
(text-property-search-forward 'face nil nil)
|
||||||
|
9 14 'bold))
|
||||||
|
|
||||||
|
(ert-deftest text-property-search-forward-prop-match-match-face-bold-t ()
|
||||||
|
(with-match-test
|
||||||
|
(text-property-search-forward 'face 'bold t)
|
||||||
|
9 14 'bold))
|
||||||
|
|
||||||
|
(ert-deftest text-property-search-forward-prop-match-match-face-bold-nil ()
|
||||||
|
(with-match-test
|
||||||
|
(text-property-search-forward 'face 'bold nil)
|
||||||
|
1 9 nil))
|
||||||
|
|
||||||
|
(ert-deftest text-property-search-backward-prop-match-match-face-nil-nil ()
|
||||||
|
(with-match-test
|
||||||
|
(text-property-search-backward 'face nil nil)
|
||||||
|
39 46 'italic
|
||||||
|
(point-max)))
|
||||||
|
|
||||||
|
(ert-deftest text-property-search-backward-prop-match-match-face-italic-t ()
|
||||||
|
(with-match-test
|
||||||
|
(text-property-search-backward 'face 'italic t)
|
||||||
|
39 46 'italic
|
||||||
|
(point-max)))
|
||||||
|
|
||||||
|
(ert-deftest text-property-search-backward-prop-match-match-face-italic-nil ()
|
||||||
|
(with-match-test
|
||||||
|
(text-property-search-backward 'face 'italic nil)
|
||||||
|
46 57 nil
|
||||||
|
(point-max)))
|
||||||
|
|
||||||
(provide 'text-property-search-tests)
|
(provide 'text-property-search-tests)
|
||||||
|
|
||||||
;;; text-property-search-tests.el ends here
|
;;; text-property-search-tests.el ends here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue