aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorEric S. Raymond2026-02-25 10:20:03 -0500
committerEric S. Raymond2026-02-25 10:24:38 -0500
commit6d7f0acf9cc15b388f90363d012aaba3d95be6c8 (patch)
tree0a8e8dcb9b269f8a708b4a41dfc1b9bcd42d617d /test/src
parentbb403e70aec25677393d4f37d544487a9aebab9e (diff)
downloademacs-6d7f0acf9cc15b388f90363d012aaba3d95be6c8.tar.gz
emacs-6d7f0acf9cc15b388f90363d012aaba3d95be6c8.zip
Tests for 2 marker primitives previously not covered.
- insertion-type - last-position-after-kill
Diffstat (limited to 'test/src')
-rw-r--r--test/src/marker-tests.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/src/marker-tests.el b/test/src/marker-tests.el
index ddd8bc702e4..92073d89724 100644
--- a/test/src/marker-tests.el
+++ b/test/src/marker-tests.el
@@ -57,4 +57,27 @@
57 (set-marker marker-2 marker-1) 57 (set-marker marker-2 marker-1)
58 (should (goto-char marker-2)))) 58 (should (goto-char marker-2))))
59 59
60(ert-deftest marker-tests--insertion-type ()
61 (with-temp-buffer
62 (insert "ab")
63 (goto-char 2)
64 (let ((m1 (point-marker))
65 (m2 (copy-marker (point) t)))
66 (should-not (marker-insertion-type m1))
67 (should (marker-insertion-type m2))
68 (insert "X")
69 (should (= (marker-position m1) 2))
70 (should (= (marker-position m2) 3)))))
71
72(ert-deftest marker-tests--last-position-after-kill ()
73 (let (marker pos)
74 (with-temp-buffer
75 (insert "abc")
76 (setq marker (point-marker))
77 (setq pos (point))
78 (should (= (marker-position marker) pos)))
79 (should-not (marker-buffer marker))
80 (should-not (marker-position marker))
81 (should (= (marker-last-position marker) pos))))
82
60;;; marker-tests.el ends here 83;;; marker-tests.el ends here