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

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

[elpa] externals/compat 7569405bc8 15/16: Restore tests


From: ELPA Syncer
Subject: [elpa] externals/compat 7569405bc8 15/16: Restore tests
Date: Wed, 4 Jan 2023 07:57:28 -0500 (EST)

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

    Restore tests
---
 compat-tests.el | 54 +++++++++++++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 08a7ff57d6..37fc1f4d69 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -44,6 +44,33 @@
     (should (eq (compat-call plist-get list "first" #'string=) 10))
     (should (eq (compat-call plist-get list "second" #'string=) 2))))
 
+(ert-deftest mapcan ()
+  (should (equal nil (mapcan #'identity nil)))
+  (should (equal (list 1)
+                 (mapcan #'identity
+                         (list (list 1)))))
+  (should (equal (list 1 2 3 4)
+                 (mapcan #'identity
+                         (list (list 1) (list 2 3) (list 4)))))
+  (should (equal (list (list 1) (list 2 3) (list 4))
+                 (mapcan #'list
+                         (list (list 1) (list 2 3) (list 4)))))
+  (should (equal (list 1 2 3 4)
+                 (mapcan #'identity
+                         (list (list 1) (list) (list 2 3) (list 4)))))
+  (should (equal (list (list 1) (list) (list 2 3) (list 4))
+                 (mapcan #'list
+                         (list (list 1) (list) (list 2 3) (list 4)))))
+  (should (equal (list)
+                 (mapcan #'identity
+                         (list (list) (list) (list) (list))))))
+
+(ert-deftest xor ()
+  (should (equal t (xor t nil)))
+  (should (equal t (xor nil t)))
+  (should (equal nil (xor nil nil)))
+  (should (equal nil (xor t t))))
+
 (ert-deftest length= ()
   (should (equal t (length= '() 0)))                  ;empty list
   (should (equal t (length= '(1) 1)))                 ;single element
@@ -644,12 +671,6 @@
 ;;   (ought '(1 2 3 4) '((1) nil 2 ((3 4))))
 ;;   (ought '(1 2 3 4) '(((1 nil)) 2 (((3 nil nil) 4)))))
 
-;; (ert-deftest xor
-;;   (ought t t nil)
-;;   (ought t nil t)
-;;   (ought nil nil nil)
-;;   (ought nil t t))
-
 ;; (ert-deftest string-distance
 ;;   (ought 3 "kitten" "sitting")     ;from wikipedia
 ;;   (if (version<= "28" emacs-version) ;trivial examples
@@ -784,27 +805,6 @@
 ;;   (ought 'd 0 '((1 . a) (2 . b) (3 . c)) 'd) ;default value
 ;;   (ought 'd 2 '((1 . a) (2 . b) (3 . c)) 'd nil #'ignore))
 
-;; (ert-deftest mapcan
-;;   (ought nil #'identity nil)
-;;   (ought (list 1)
-;;          #'identity
-;;          (list (list 1)))
-;;   (ought (list 1 2 3 4)
-;;          #'identity
-;;          (list (list 1) (list 2 3) (list 4)))
-;;   (ought (list (list 1) (list 2 3) (list 4))
-;;          #'list
-;;          (list (list 1) (list 2 3) (list 4)))
-;;   (ought (list 1 2 3 4)
-;;          #'identity
-;;          (list (list 1) (list) (list 2 3) (list 4)))
-;;   (ought (list (list 1) (list) (list 2 3) (list 4))
-;;          #'list
-;;          (list (list 1) (list) (list 2 3) (list 4)))
-;;   (ought (list)
-;;          #'identity
-;;          (list (list) (list) (list) (list))))
-
 ;; ;; Note: as the cXXX+r implementations are relatively trivial, their
 ;; ;; tests are not as extensive.
 



reply via email to

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