summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMauro Aranda <maurooaranda@gmail.com>2021-01-19 09:11:37 -0300
committerMauro Aranda <maurooaranda@gmail.com>2021-01-19 09:11:37 -0300
commit33ff86a20ab5a0b6a7ffe5056341334c4bcafca6 (patch)
tree7d701ced06250743929e91c0119d3fe4f74e0fe4 /test
parentba0cf1d7017894ff9e539cba83881865b3a025a1 (diff)
downloademacs-33ff86a20ab5a0b6a7ffe5056341334c4bcafca6.tar.gz
Add test for the widget-color-match function (Bug#45829)
* test/lisp/wid-edit-tests.el (widget-test-color-match): New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/wid-edit-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el
index 17fdfefce84..f843649784a 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