Files
jspg/fixtures/maxLength.json

91 lines
1.9 KiB
JSON

[
{
"description": "maxLength validation",
"database": {
"schemas": [
{
"maxLength": 2,
"$id": "maxLength_0_0"
}
]
},
"tests": [
{
"description": "shorter is valid",
"data": "f",
"schema_id": "maxLength_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "exact length is valid",
"data": "fo",
"schema_id": "maxLength_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "too long is invalid",
"data": "foo",
"schema_id": "maxLength_0_0",
"action": "validate",
"expect": {
"success": false
}
},
{
"description": "ignores non-strings",
"data": 100,
"schema_id": "maxLength_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "two graphemes is long enough",
"data": "💩💩",
"schema_id": "maxLength_0_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "maxLength validation with a decimal",
"database": {
"schemas": [
{
"maxLength": 2,
"$id": "maxLength_1_0"
}
]
},
"tests": [
{
"description": "shorter is valid",
"data": "f",
"schema_id": "maxLength_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "too long is invalid",
"data": "foo",
"schema_id": "maxLength_1_0",
"action": "validate",
"expect": {
"success": false
}
}
]
}
]