Skip to content

Commit 2c8e33d

Browse files
committed
patternProperties: check regex engine matching more completely
* Regex matches are not anchored. * Matching is case insensitive.
1 parent c739935 commit 2c8e33d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/draft3/patternProperties.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,36 @@
7070
"valid": false
7171
}
7272
]
73+
},
74+
{
75+
"description": "regexes are not anchored by default and are case sensitive",
76+
"schema": {
77+
"patternProperties": {
78+
"[0-9]{2,}": { "type": "boolean" },
79+
"X_": { "type": "string" }
80+
}
81+
},
82+
"tests": [
83+
{
84+
"description": "non recognized members are ignored",
85+
"data": { "answer 1": "42" },
86+
"valid": true
87+
},
88+
{
89+
"description": "recognized members are accounted for",
90+
"data": { "a31b": null },
91+
"valid": false
92+
},
93+
{
94+
"description": "regexes are case sensitive",
95+
"data": { "a_x_3": 3 },
96+
"valid": true
97+
},
98+
{
99+
"description": "regexes are case sensitive, 2",
100+
"data": { "a_X_3": 3 },
101+
"valid": false
102+
}
103+
]
73104
}
74105
]

0 commit comments

Comments
 (0)