109 lines
2.2 KiB
JSON
109 lines
2.2 KiB
JSON
[
|
|
{
|
|
"description": "pattern validation",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"pattern": "^a*$",
|
|
"$id": "pattern_0_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "a matching pattern is valid",
|
|
"data": "aaa",
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "a non-matching pattern is invalid",
|
|
"data": "abc",
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": false
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores booleans",
|
|
"data": true,
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores integers",
|
|
"data": 123,
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores floats",
|
|
"data": 1,
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores objects",
|
|
"data": {},
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores arrays",
|
|
"data": [],
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores null",
|
|
"data": null,
|
|
"schema_id": "pattern_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "pattern is not anchored",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"pattern": "a+",
|
|
"$id": "pattern_1_0"
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "matches a substring",
|
|
"data": "xxaayy",
|
|
"schema_id": "pattern_1_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |