diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-01-07 13:08:45 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-01-07 13:08:52 +0100 |
commit | 2f6e30cd86a575ef06e8d056fbb6582336f6aadd (patch) | |
tree | de9b39322e130df388badd094d106603f470a1d1 /test/lisp/textmodes/paragraphs-tests.el | |
parent | 9db1c0993a99853968c021d094eba37c0cae60bb (diff) | |
download | emacs-2f6e30cd86a575ef06e8d056fbb6582336f6aadd.tar.gz emacs-2f6e30cd86a575ef06e8d056fbb6582336f6aadd.tar.bz2 emacs-2f6e30cd86a575ef06e8d056fbb6582336f6aadd.zip |
Revert mark-paragraph change and add tests
* lisp/textmodes/paragraphs.el (mark-paragraph): Revert
eb090f65ceb0ae8a90829e911694348583135ba5 (bug#45318). This restores
the behaviour from Emacs 27 -- further work is needed on this patch.
Diffstat (limited to 'test/lisp/textmodes/paragraphs-tests.el')
-rw-r--r-- | test/lisp/textmodes/paragraphs-tests.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lisp/textmodes/paragraphs-tests.el b/test/lisp/textmodes/paragraphs-tests.el index bf7f37090f5..712169029de 100644 --- a/test/lisp/textmodes/paragraphs-tests.el +++ b/test/lisp/textmodes/paragraphs-tests.el @@ -24,6 +24,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) ;; (require 'paragraphs) ; loaded by default (ert-deftest paragraphs-tests-sentence-end () @@ -161,5 +162,27 @@ (should (equal (buffer-string) "First sentence. Third sentence. Second sentence.")))) +(ert-deftest test-mark-paragraphs () + (with-current-buffer + (find-file-noselect (ert-resource-file "mark-paragraph.bin")) + (goto-char (point-max)) + ;; Just a sanity check that the file hasn't changed. + (should (= (point) 54)) + (mark-paragraph) + (should (= (point) 42)) + (should (= (mark) 54)) + ;; Doesn't move. + (mark-paragraph) + (should (= (point) 42)) + (should (= (mark) 54)) + (forward-line -1) + (mark-paragraph) + (should (= (point) 25)) + (should (= (mark) 42)) + (goto-char (point-min)) + (mark-paragraph) + (should (= (point) 1)) + (should (= (mark) 17)))) + (provide 'paragraphs-tests) ;;; paragraphs-tests.el ends here |