Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/draft2020-12/pattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,29 @@
"valid": true
}
]
},
{
"description": "unicode literal in pattern",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"pattern": "^π$"
},
"tests": [
{
"description": "matches single unicode character",
"data": "π",
"valid": true
},
{
"description": "ASCII character does not match",
"data": "p",
"valid": false
},
{
"description": "multiple unicode characters do not match",
"data": "ππ",
"valid": false
}
]
}
]
28 changes: 28 additions & 0 deletions tests/draft2020-12/patternProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,33 @@
"valid": true
}
]
},
{
"description": "unicode literal in patternProperties",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"patternProperties": {
"^π": { "type": "number" }
},
"additionalProperties": true
},
"tests": [
{
"description": "property name starting with unicode character matches",
"data": { "πValue": 3 },
"valid": true
},
{
"description": "matching property name with wrong type is invalid",
"data": { "πValue": "three" },
"valid": false
},
{
"description": "non-matching property name is ignored",
"data": { "pValue": "three" },
"valid": true
}
]
}
]
Loading