From: Lars Ingebrigtsen Date: Sun, 19 Dec 2021 16:12:18 +0000 (+0100) Subject: Add some very rudimentary field-beginning/end tests X-Git-Tag: emacs-29.0.90~3571 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f6959d05f4b9015ea79050053898b85a1af3ea91;p=emacs.git Add some very rudimentary field-beginning/end tests --- diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index e83dd7c857b..6b2eb32396e 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -413,4 +413,17 @@ (translate-region-internal (point-min) (point-max) tt) (should (string-equal (buffer-string) "*"))))) +(ert-deftest find-fields () + (with-temp-buffer + (insert "foo" (propertize "bar" 'field 'bar) "zot") + (goto-char (point-min)) + (should (= (field-beginning) (point-min))) + (should (= (field-end) 4)) + (goto-char 5) + (should (= (field-beginning) 4)) + (should (= (field-end) 7)) + (goto-char 8) + (should (= (field-beginning) 7)) + (should (= (field-end) (point-max))))) + ;;; editfns-tests.el ends here