branch: externals/validate
commit 3287503edfd76e1cd21c0ddada54f610901ed010
Author: Artur Malabarba <[email protected]>
Commit: Artur Malabarba <[email protected]>
Fix case when const uses :value - Fix #7
---
validate.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/validate.el b/validate.el
index a51cd81..eb78567 100644
--- a/validate.el
+++ b/validate.el
@@ -97,8 +97,9 @@ If they don't match, return an explanation."
((wtype 'list))
(t (let ((subschema (car args)))
(seq-some (lambda (v) (validate--check v
subschema)) value)))))
- ((const function-item variable-item) (unless (equal value (car
args))
- "not the expected
value"))
+ ((const function-item variable-item)
+ (unless (equal value (or (plist-get props :value) (car args)))
+ "not the expected value"))
(file (cond ((wtype 'string))
((file-exists-p value) nil)
((plist-get props :must-match) "file does not
exist")