Tags

Ns

Symbols

zen.tests.schema
{
map-require
{
:schema
{
:require
#{
:d
:a
#{
:c
:b
:typezen/map
:keys
{
:c
:b
:d
:a
:zen/tags
: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"
map-exclusive-keys
{
:schema
{
:typezen/map
:keys
{
:c
:b
:d
:a
:exclusive-keys
#{
#{
#{
:c
:d
:b
#{
:b
:a
:zen/tags
: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
{
:minLength
2
:maxLength
5
:regex
".*@.*"
:zen/tags
: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
:typezen/map
:keys
{
:schema
{
:confirms
:typezen/map
:title
:cases
{
:key
:typezen/map
:values
{
:typezen/map
:keys
{
:valid
:result
{
:typezen/map
:example
{
:typezen/any
valid-schemas
{
:schema
{
:confirms
:zen/tags
:title
"Valid schemas"
:cases
{
:require-with-or
{
:valid
?true
:example
{
:require
#{
:a
#{
:c
:b
:typezen/map
:simple-require
{
:valid
?true
:example
{
:require
#{
:c
:b
:a
:typezen/map