emacs-diffs
[Top][All Lists]
Advanced

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

master 33ff86a 2/2: Add test for the widget-color-match function (Bug#45


From: Mauro Aranda
Subject: master 33ff86a 2/2: Add test for the widget-color-match function (Bug#45829)
Date: Tue, 19 Jan 2021 07:18:30 -0500 (EST)

branch: master
commit 33ff86a20ab5a0b6a7ffe5056341334c4bcafca6
Author: Mauro Aranda <maurooaranda@gmail.com>
Commit: Mauro Aranda <maurooaranda@gmail.com>

    Add test for the widget-color-match function (Bug#45829)
    
    * test/lisp/wid-edit-tests.el (widget-test-color-match): New test.
---
 test/lisp/wid-edit-tests.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el
index 17fdfef..f843649 100644
--- a/test/lisp/wid-edit-tests.el
+++ b/test/lisp/wid-edit-tests.el
@@ -322,4 +322,15 @@ return nil, even with a non-nil bubblep argument."
     (widget-backward 1)
     (should (string= "Second" (widget-value (widget-at))))))
 
+(ert-deftest widget-test-color-match ()
+  "Test that the :match function for the color widget works."
+  (let ((widget (widget-convert 'color)))
+    (should (widget-apply widget :match "red"))
+    (should (widget-apply widget :match "#fa3"))
+    (should (widget-apply widget :match "#ff0000"))
+    (should (widget-apply widget :match "#111222333"))
+    (should (widget-apply widget :match "#111122223333"))
+    (should-not (widget-apply widget :match "someundefinedcolorihope"))
+    (should-not (widget-apply widget :match "#11223"))))
+
 ;;; wid-edit-tests.el ends here



reply via email to

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