diff options
| -rw-r--r-- | test/lisp/emacs-lisp/text-property-search-tests.el | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/text-property-search-tests.el b/test/lisp/emacs-lisp/text-property-search-tests.el index 47db54a0512..21a25c7835f 100644 --- a/test/lisp/emacs-lisp/text-property-search-tests.el +++ b/test/lisp/emacs-lisp/text-property-search-tests.el | |||
| @@ -108,6 +108,49 @@ | |||
| 108 | '("bold1") | 108 | '("bold1") |
| 109 | 35)) | 109 | 35)) |
| 110 | 110 | ||
| 111 | (defmacro with-match-test (form beginning end value &optional point) | ||
| 112 | `(with-temp-buffer | ||
| 113 | (text-property-setup) | ||
| 114 | (when ,point | ||
| 115 | (goto-char ,point)) | ||
| 116 | (should (equal ,form | ||
| 117 | (make-prop-match :beginning ,beginning | ||
| 118 | :end ,end | ||
| 119 | :value ,value))))) | ||
| 120 | |||
| 121 | (ert-deftest text-property-search-forward-prop-match-match-face-nil-nil () | ||
| 122 | (with-match-test | ||
| 123 | (text-property-search-forward 'face nil nil) | ||
| 124 | 9 14 'bold)) | ||
| 125 | |||
| 126 | (ert-deftest text-property-search-forward-prop-match-match-face-bold-t () | ||
| 127 | (with-match-test | ||
| 128 | (text-property-search-forward 'face 'bold t) | ||
| 129 | 9 14 'bold)) | ||
| 130 | |||
| 131 | (ert-deftest text-property-search-forward-prop-match-match-face-bold-nil () | ||
| 132 | (with-match-test | ||
| 133 | (text-property-search-forward 'face 'bold nil) | ||
| 134 | 1 9 nil)) | ||
| 135 | |||
| 136 | (ert-deftest text-property-search-backward-prop-match-match-face-nil-nil () | ||
| 137 | (with-match-test | ||
| 138 | (text-property-search-backward 'face nil nil) | ||
| 139 | 39 46 'italic | ||
| 140 | (point-max))) | ||
| 141 | |||
| 142 | (ert-deftest text-property-search-backward-prop-match-match-face-italic-t () | ||
| 143 | (with-match-test | ||
| 144 | (text-property-search-backward 'face 'italic t) | ||
| 145 | 39 46 'italic | ||
| 146 | (point-max))) | ||
| 147 | |||
| 148 | (ert-deftest text-property-search-backward-prop-match-match-face-italic-nil () | ||
| 149 | (with-match-test | ||
| 150 | (text-property-search-backward 'face 'italic nil) | ||
| 151 | 46 57 nil | ||
| 152 | (point-max))) | ||
| 153 | |||
| 111 | (provide 'text-property-search-tests) | 154 | (provide 'text-property-search-tests) |
| 112 | 155 | ||
| 113 | ;;; text-property-search-tests.el ends here | 156 | ;;; text-property-search-tests.el ends here |