From f6959d05f4b9015ea79050053898b85a1af3ea91 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 19 Dec 2021 17:12:18 +0100 Subject: [PATCH] Add some very rudimentary field-beginning/end tests --- test/src/editfns-tests.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- 2.39.2