branch: master
commit 9f74310db5f779b2a850da188696446965b833b9
Author: Ryan C. Thompson <[email protected]>
Commit: Ryan C. Thompson <[email protected]>

    Add test for ivy-completing-read-default-is-empty-string
---
 ivy-test.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ivy-test.el b/ivy-test.el
index 9360b6fe..5385e09 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -520,21 +520,31 @@
 
 (ert-deftest ivy-completing-read-default ()
   (should
+   ;; DEF in COLLECTION
    (equal "b"
           (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil 
nil "b")
                     "RET")))
+  ;; DEF not in COLLECTION
   (should
    (equal "d"
           (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil 
nil "d")
                     "RET")))
+  ;; DEF list, some in COLLECTION
   (should
    (equal "e"
           (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil 
nil '("e" "b"))
                     "RET")))
+  ;; DEF nil
   (should
    (equal ""
           (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil 
nil nil)
-                    "RET"))))
+                    "RET")))
+  ;; DEF nil, and `ivy-completing-read-default-is-empty-string' also nil
+  (should
+   (equal "a"
+          (let ((ivy-completing-read-default-is-empty-string nil))
+            (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil 
nil nil)
+                      "RET")))))
 
 (provide 'ivy-test)
 

Reply via email to