\f
;;;; Position after search.
-(defun text-property-search--pos-test (fun pos &optional reverse)
+(ert-deftest text-property-search-forward/point-at-beginning ()
(with-temp-buffer
- (insert (concat "foo "
- (propertize "bar" 'x t)
- " baz"))
- (goto-char (if reverse (point-max) (point-min)))
- (funcall fun 'x t)
- (should (= (point) pos))))
-
-(ert-deftest text-property-search-forward-point-at-beginning ()
- (text-property-search--pos-test #'text-property-search-forward 5))
-
-(ert-deftest text-property-search-backward-point-at-end ()
- (text-property-search--pos-test #'text-property-search-backward 8 t))
+ (insert (concat "1234" (propertize "567" 'x t) "890"))
+ (goto-char (point-min))
+ (text-property-search-forward 'x t)
+ (should (= (point) 5))))
+
+(ert-deftest text-property-search-backward/point-at-end ()
+ (with-temp-buffer
+ (insert (concat "1234" (propertize "567" 'x t) "890"))
+ (goto-char (point-max))
+ (text-property-search-backward 'x t)
+ (should (= (point) 8))))
(provide 'text-property-search-tests)