emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat 00f738032f: Minor test suite improvements


From: ELPA Syncer
Subject: [elpa] externals/compat 00f738032f: Minor test suite improvements
Date: Mon, 16 Jan 2023 15:57:26 -0500 (EST)

branch: externals/compat
commit 00f738032f90caab31f1ceb3ac9f28088f3f7d88
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Minor test suite improvements
---
 compat-tests.el | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 6b0c812d75..16bad8929f 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"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]