diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-01-16 21:05:01 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-01-16 21:12:01 +0100 |
| commit | 00f738032f90caab31f1ceb3ac9f28088f3f7d88 (patch) | |
| tree | 51473f33dd06b572728c883728aeec7bc2c8fc61 | |
| parent | 866639ed2df830c5961bec5e021ab7451973e551 (diff) | |
Minor test suite improvements
| -rw-r--r-- | compat-tests.el | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/compat-tests.el b/compat-tests.el index 6b0c812..16bad89 100644 --- a/compat-tests.el +++ b/compat-tests.el @@ -1238,7 +1238,6 @@ (push (concat file "~") backups) (make-empty-file (car backups)) (should-equal backups (file-backup-file-names file)) - ;; (sleep-for 1) ;; FIXME Slowing down the test suite here is not great. (push (concat file ".~1~") backups) (make-empty-file (car backups)) (should-equal backups (sort (file-backup-file-names file) #'string<)))) @@ -1689,9 +1688,15 @@ (ert-deftest string-lines () (should-equal '("a" "b" "c") (string-lines "a\nb\nc")) - ;; TODO behavior changed on Emacs master (Emacs version 30) - ;; (should-equal '("a" "b" "c" "") (string-lines "a\nb\nc\n")) + ;; FIXME: Behavior changed on Emacs 30 + (compat-tests--if (< emacs-major-version 29) + (should-equal '("a" "b" "c" "") (string-lines "a\nb\nc\n")) + (should-equal '("a" "b" "c") (string-lines "a\nb\nc\n")) + (should-equal '("a\n" "\n" "b\n" "c\n") (string-lines "a\n\nb\nc\n" nil t)) + (should-equal '("a\n" "b\n" "c\n") (string-lines "a\n\nb\nc\n" t t)) + (should-equal '("a\n" "b\n" "c\n") (string-lines "a\nb\nc\n" nil t))) (should-equal '("a" "b" "c") (string-lines "a\nb\nc\n" t)) + (should-equal '("a" "b" "c") (string-lines "a\nb\n\nc\n" t)) (should-equal '("abc" "bcd" "cde") (string-lines "abc\nbcd\ncde")) (should-equal '(" abc" " bcd " "cde ") (string-lines " abc\n bcd \ncde "))) @@ -1712,17 +1717,11 @@ (ert-deftest string-distance () (should-equal 3 (string-distance "kitten" "sitting")) ;from wikipedia - (if (version<= "28" emacs-version) ;trivial examples - (should-equal 0 (string-distance "" "")) - ;; Up until Emacs 28, `string-distance' had a bug - ;; when comparing two empty strings. This was fixed - ;; in the following commit: - ;; https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c44190c - ;; - ;; TODO Therefore, we must make sure, that the test - ;; doesn't fail because of this bug: - ;; (should (= (string-distance "" "") 0)) - ) + ;; In Emacs 27, `string-distance' had a bug when comparing two empty + ;; strings. This was fixed in the following commit: + ;; https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c44190c + (when (/= emacs-major-version 27) + (should-equal 0 (string-distance "" ""))) (should-equal 0 (string-distance "a" "a")) (should-equal 1 (string-distance "" "a")) (should-equal 1 (string-distance "b" "a")) |
