diff options
| author | Philip Kaludercic <philipk@posteo.net> | 2023-08-17 23:24:58 +0200 |
|---|---|---|
| committer | Philip Kaludercic <philipk@posteo.net> | 2023-08-17 23:24:58 +0200 |
| commit | bf4b9aaa2e80cae253f23561b93a2feacf74d004 (patch) | |
| tree | 9e9449e3bbc3780b0bfbdabb8d0a741c8ab061fd /compat-tests.el | |
| parent | d843192e6430bc1f135efb5822dc6fb033d3a95f (diff) | |
| parent | 75d0b8527f51aae42d23eee4aeb263e19055747e (diff) | |
Merge branch 'master' into emacs-30
Diffstat (limited to 'compat-tests.el')
| -rw-r--r-- | compat-tests.el | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/compat-tests.el b/compat-tests.el index 3793574..1bb1f3e 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -406,6 +406,15 @@ (should-equal (getenv A) B)) (should-not (getenv A)))) +(ert-deftest compat-window-configuration-equal-p () + (let ((wc (current-window-configuration))) + (should (window-configuration-equal-p wc wc)) + (save-window-excursion + (with-temp-buffer + (pop-to-buffer (current-buffer)) + (should-not (window-configuration-equal-p (current-window-configuration) wc)))) + (should (window-configuration-equal-p (current-window-configuration) wc)))) + (ert-deftest compat-with-window-non-dedicated () (unwind-protect (progn @@ -1828,6 +1837,12 @@ (should-equal (replace-regexp-in-region " bar" "" (point-min) 8) 1) (should-equal (buffer-string) "foo bar")))) +(ert-deftest compat-char-uppercase-p () + (dolist (c (list ?R ?S ?Ω ?Ψ)) + (should (char-uppercase-p c))) + (dolist (c (list ?a ?b ?α ?β)) + (should-not (char-uppercase-p c)))) + (ert-deftest compat-string-split () (should-equal '("a" "b" "c") (split-string "a b c")) (should-equal '("a" "b" "c") (string-split "a b c"))) @@ -2121,7 +2136,12 @@ ;; backport this behaviour. (should-equal 2 (string-search (compat-tests--string-to-multibyte "\377") "ab\377c")) (should-equal 2 (string-search (compat-tests--string-to-multibyte "o\303\270") - "foo\303\270")))) + "foo\303\270"))) + ;; Ensure that `match-data' is preserved by `string-search' + (string-match (rx (* "a") (group (* "b")) (* "a")) "abba") + (should-equal '(0 4 1 3) (match-data)) + (should (string-search "foo" "foobar")) + (should-equal '(0 4 1 3) (match-data))) (ert-deftest compat-string-replace () (should-equal "bba" (string-replace "aa" "bb" "aaa")) |
