diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2025-03-02 18:40:31 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2025-03-02 18:40:31 +0100 |
| commit | 2face40462597d99d22be4a9a6a4c28e2dd8e4af (patch) | |
| tree | 88f6c7a2266b7a8a5596765290dd136278908fc3 | |
| parent | 275bbd1852948a7fb3948b3e7b672e958cb2d1b9 (diff) | |
compat-tests.el: Restore compat-region-noncontiguous-p
| -rw-r--r-- | compat-tests.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compat-tests.el b/compat-tests.el index 932ca03..fedbda2 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -2742,6 +2742,21 @@ (goto-char 7) (should-equal (region-bounds) '((2 . 7))))) +(ert-deftest compat-region-noncontiguous-p () + (let ((region-extract-function (lambda (_) '((2 . 3) (6 . 7))))) + (should (region-noncontiguous-p))) + (with-temp-buffer + (insert "abc\ndef\n") + (set-mark 2) + (goto-char 7) + (transient-mark-mode) + (should-not (region-noncontiguous-p)) + (should-not (use-region-noncontiguous-p)) + (should (use-region-p)) + (let ((region-extract-function (lambda (_) '((2 . 3) (6 . 7))))) + (should (region-noncontiguous-p)) + (should (use-region-noncontiguous-p))))) + (ert-deftest compat-get-scratch-buffer-create () (should-equal "*scratch*" (buffer-name (get-scratch-buffer-create))) (should-equal initial-major-mode |
