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

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

[elpa] externals/compat 1a5c5e0379 07/13: Restore tests


From: ELPA Syncer
Subject: [elpa] externals/compat 1a5c5e0379 07/13: Restore tests
Date: Wed, 4 Jan 2023 09:57:31 -0500 (EST)

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

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

diff --git a/compat-tests.el b/compat-tests.el
index 4c4b28f88c..5f4c74ff80 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -53,6 +53,39 @@
     (should (eq (compat-call plist-get list "first" #'string=) 10))
     (should (eq (compat-call plist-get list "second" #'string=) 2))))
 
+(ert-deftest provided-mode-derived-p ()
+  (let ((one (make-symbol "1"))
+        (two (make-symbol "2"))
+        (three (make-symbol "3"))
+        (one.5 (make-symbol "1.5"))
+        (eins (make-symbol "𝟙")))
+    (put two 'derived-mode-parent one)
+    (put one.5 'derived-mode-parent one)
+    (put three 'derived-mode-parent two)
+    (should-equal one (provided-mode-derived-p one one))
+    (should-equal one (provided-mode-derived-p two one))
+    (should-equal one (provided-mode-derived-p three one))
+    (should-equal nil (provided-mode-derived-p one eins))
+    (should-equal nil (provided-mode-derived-p two eins))
+    (should-equal nil (provided-mode-derived-p two one.5))
+    (should-equal one (provided-mode-derived-p two one.5 one))
+    (should-equal two (provided-mode-derived-p two one.5 two))
+    (should-equal one (provided-mode-derived-p three one.5 one))
+    (should-equal two (provided-mode-derived-p three one.5 one two))
+    (should-equal two (provided-mode-derived-p three one.5 two one))
+    (should-equal three (provided-mode-derived-p three one.5 two one three))
+    (should-equal three (provided-mode-derived-p three one.5 three two one))))
+
+(ert-deftest format-prompt ()
+  (should-equal "Prompt: " (format-prompt "Prompt" nil))
+  (should-equal "Prompt: " (format-prompt "Prompt" ""))
+  (should-equal "Prompt (default  ): " (format-prompt "Prompt" " "))
+  (should-equal "Prompt (default 3): " (format-prompt "Prompt" 3))
+  (should-equal "Prompt (default abc): " (format-prompt "Prompt" "abc"))
+  (should-equal "Prompt (default abc def): " (format-prompt "Prompt" "abc 
def"))
+  (should-equal "Prompt 10: " (format-prompt "Prompt %d" nil 10))
+  (should-equal "Prompt \"abc\" (default 3): " (format-prompt "Prompt %S" 3 
"abc")))
+
 (ert-deftest cXXXr ()
   (let ((xxx '(((a . b) . (c . d)) . ((e . f) . (g . h)))))
     (should-equal nil (caaar ()))
@@ -1233,16 +1266,6 @@
 ;;   (should-equal '(if a (progn b)) '(when a b))
 ;;   (should-equal '(if a (progn (unless b c))) '(when a (unless b c))))
 
-;; (ert-deftest format-prompt
-;;   (should-equal "Prompt: " "Prompt" nil)
-;;   (should-equal "Prompt: " "Prompt" "")
-;;   (should-equal "Prompt (default  ): " "Prompt" " ")
-;;   (should-equal "Prompt (default 3): " "Prompt" 3)
-;;   (should-equal "Prompt (default abc): " "Prompt" "abc")
-;;   (should-equal "Prompt (default abc def): " "Prompt" "abc def")
-;;   (should-equal "Prompt 10: " "Prompt %d" nil 10)
-;;   (should-equal "Prompt \"abc\" (default 3): " "Prompt %S" 3 "abc"))
-
 ;; ;; TODO fix broken test
 ;; ;;(ert-deftest directory-files-recursively
 ;; ;;  (should-equal
@@ -1694,29 +1717,6 @@
 ;; ;;   (should-equal '(2 . 3) 'defalias)
 ;; ;;   (should-equal '(1 . unevalled) 'defvar))
 
-;; (let ((one (make-symbol "1"))
-;;       (two (make-symbol "2"))
-;;       (three (make-symbol "3"))
-;;       (one.5 (make-symbol "1.5"))
-;;       (eins (make-symbol "𝟙")))
-;;   (put two 'derived-mode-parent one)
-;;   (put one.5 'derived-mode-parent one)
-;;   (put three 'derived-mode-parent two)
-;;   (ert-deftest provided-mode-derived-p
-;;     (should-equal one one one)
-;;     (should-equal one two one)
-;;     (should-equal one three one)
-;;     (should-equal nil one eins)
-;;     (should-equal nil two eins)
-;;     (should-equal nil two one.5)
-;;     (should-equal one two one.5 one)
-;;     (should-equal two two one.5 two)
-;;     (should-equal one three one.5 one)
-;;     (should-equal two three one.5 one two)
-;;     (should-equal two three one.5 two one)
-;;     (should-equal three three one.5 two one three)
-;;     (should-equal three three one.5 three two one)))
-
 ;; (unless (fboundp 'make-prop-match)
 ;;   (defalias 'make-prop-match
 ;;     (if (version< emacs-version "26.1")



reply via email to

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