diff options
| author | 2021-11-11 22:16:39 -0600 | |
|---|---|---|
| committer | 2021-11-11 22:16:39 -0600 | |
| commit | 2732fd0bb21f7fb3ab456e0ec4ff0661831f30a0 (patch) | |
| tree | 20f9f978dfd27ac58a5f00318a75123be3ec57ed /test | |
| parent | Fix schema syntax description comment. (diff) | |
Fix `prop` schema combinator and add a testcase.
Diffstat (limited to 'test')
| -rw-r--r-- | test/suite0013.janet | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/suite0013.janet b/test/suite0013.janet index d7d2df6..9d1b72d 100644 --- a/test/suite0013.janet +++ b/test/suite0013.janet @@ -23,4 +23,13 @@ (assert-no-error "validator v1 2" (v1 math/nan)) (assert-error "validator v1 3" (v1 :hello)) +(def v2 + (schema/validator + (props + :a :number + :b :number + :c (or :string nil)))) +(assert-no-error "validator v2 1" (v2 {:a 1 :b 2})) +(assert-no-error "validator v2 2" (v2 {:a 1 :b 2 :c "hello"})) + (end-suite) |
