Tags
zen/coll
zen/primitive
zen/property
zen/schema
zen/tag
zen/type
zen.tests.schema/test-case
Ns
zen
zen.tests.schema
Symbols
zen/any
zen/boolean
zen/case
zen/coll
zen/ctx
zen/date
zen/datetime
zen/desc
zen/errors
zen/file
zen/integer
zen/keyword
zen/map
zen/name
zen/number
zen/operation
zen/primitive
zen/property
zen/regex
zen/resource
zen/schema
zen/schema-errors
zen/schema-result
zen/set
zen/string
zen/symbol
zen/tag
zen/tags
zen/type
zen/validation-fn
zen/vector
zen.tests.schema/map-exclusive-keys
zen.tests.schema/map-require
zen.tests.schema/str
zen.tests.schema/test-case
zen.tests.schema/valid-schemas
zen.tests.schema
{
map-require
{
:schema
{
:require
#{
:d
:a
#{
:c
:b
:type
zen/map
:keys
{
:c
{
:type
zen/string
:b
{
:type
zen/string
:d
{
:type
zen/string
:a
{
:type
zen/string
:zen/tags
#{
test-case
:title
"Test zen/map require"
:cases
{
:simple
{
:valid
?true
:example
{
:b
"b"
:d
"c"
:a
"a"
:missed-or
{
:result
[
[0]
{
:path
[
:schema
[
[0]
:require
:type
"map.require"
:message
"one of keys #{:c :b} is required"
:example
{
:d
"d"
:a
"a"
ns
zen.tests.schema
map-exclusive-keys
{
:schema
{
:type
zen/map
:keys
{
:c
{
:type
zen/string
:b
{
:type
zen/string
:d
{
:type
zen/string
:a
{
:type
zen/string
:exclusive-keys
#{
#{
#{
:c
:d
:b
#{
:b
:a
:zen/tags
#{
test-case
:title
"Test zen/map exclusive keys"
:cases
{
:invalid-2
{
:result
[
[0]
{
:schema
[
[0]
:exclusive-keys
:type
"map.exclusive-keys"
:message
"Expected only one of keyset #{:c :d} or :b, but present (:c :b)"
:example
{
:c
"c"
:b
"b"
:simple
{
:valid
?true
:example
{
:c
"c"
:d
"d"
:a
"a"
:invalid-1
{
:result
[
[0]
{
:schema
[
[0]
:exclusive-keys
:type
"map.exclusive-keys"
:message
"Expected only one of keyset :b or :a, but present (:b :a)"
:example
{
:b
"b"
:a
"a"
:set-of
{
:valid
?true
:example
{
:b
"b"
str
{
:schema
{
:type
zen/string
:minLength
2
:maxLength
5
:regex
".*@.*"
:zen/tags
#{
test-case
:title
"Test zen/string"
:cases
{
:simple
{
:valid
?true
:example
"a@b"
:minLength
{
:result
[
[0]
{
:path
[
:schema
[
[0]
:minLength
:type
"string.minLength"
:message
"Expected length >= 2, got 1"
:example
"@"
:maxLength
{
:result
[
[0]
{
:schema
[
[0]
:maxLength
:type
"string.maxLength"
:message
"Expected length <= 5, got 7"
:example
"aaa@aaa"
:regex
{
:result
[
[0]
{
:path
[
:schema
[
[0]
:regex
:type
"string.regex"
:message
"Expected match /.*@.*/, got \"a*b\""
:example
"a*b"
test-case
{
:zen/tags
#{
zen/schema
:type
zen/map
:keys
{
:schema
{
:confirms
#{
zen/schema
:type
zen/map
:title
{
:type
zen/string
:cases
{
:key
{
:type
zen/keyword
:type
zen/map
:values
{
:type
zen/map
:keys
{
:valid
{
:type
zen/boolean
:result
{
:confirms
#{
zen/schema-errors
:type
zen/map
:example
{
:type
zen/any
valid-schemas
{
:schema
{
:confirms
#{
zen/schema
:zen/tags
#{
test-case
:title
"Valid schemas"
:cases
{
:require-with-or
{
:valid
?true
:example
{
:require
#{
:a
#{
:c
:b
:type
zen/map
:simple-require
{
:valid
?true
:example
{
:require
#{
:c
:b
:a
:type
zen/map