Skip to content

Commit 361620e

Browse files
committed
[355] Move non-BMP pattern tests to optional
1 parent e1f870b commit 361620e

15 files changed

+410
-390
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[
2+
{
3+
"description": "Proper UTF-16 surrogate pair handling: pattern",
4+
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
5+
"schema": { "pattern": "^🐲*$" },
6+
"tests": [
7+
{
8+
"description": "matches empty",
9+
"data": "",
10+
"valid": true
11+
},
12+
{
13+
"description": "matches single",
14+
"data": "🐲",
15+
"valid": true
16+
},
17+
{
18+
"description": "matches two",
19+
"data": "🐲🐲",
20+
"valid": true
21+
},
22+
{
23+
"description": "doesn't match one",
24+
"data": "🐉",
25+
"valid": false
26+
},
27+
{
28+
"description": "doesn't match two",
29+
"data": "🐉🐉",
30+
"valid": false
31+
},
32+
{
33+
"description": "doesn't match one ASCII",
34+
"data": "D",
35+
"valid": false
36+
},
37+
{
38+
"description": "doesn't match two ASCII",
39+
"data": "DD",
40+
"valid": false
41+
}
42+
]
43+
},
44+
{
45+
"description": "Proper UTF-16 surrogate pair handling: patternProperties",
46+
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
47+
"schema": {
48+
"patternProperties": {
49+
"^🐲*$": {
50+
"type": "integer"
51+
}
52+
}
53+
},
54+
"tests": [
55+
{
56+
"description": "matches empty",
57+
"data": { "": 1 },
58+
"valid": true
59+
},
60+
{
61+
"description": "matches single",
62+
"data": { "🐲": 1 },
63+
"valid": true
64+
},
65+
{
66+
"description": "matches two",
67+
"data": { "🐲🐲": 1 },
68+
"valid": true
69+
},
70+
{
71+
"description": "doesn't match one",
72+
"data": { "🐲": "hello" },
73+
"valid": false
74+
},
75+
{
76+
"description": "doesn't match two",
77+
"data": { "🐲🐲": "hello" },
78+
"valid": false
79+
}
80+
]
81+
}
82+
]

tests/draft2019-09/pattern.json

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -55,46 +55,5 @@
5555
"valid": true
5656
}
5757
]
58-
},
59-
{
60-
"description": "non-BMP, checks for proper surrogate pair handling for UTF-16",
61-
"schema": { "pattern": "^🐲*$" },
62-
"tests": [
63-
{
64-
"description": "matches empty",
65-
"data": "",
66-
"valid": true
67-
},
68-
{
69-
"description": "matches single",
70-
"data": "🐲",
71-
"valid": true
72-
},
73-
{
74-
"description": "matches two",
75-
"data": "🐲🐲",
76-
"valid": true
77-
},
78-
{
79-
"description": "doesn't match one",
80-
"data": "🐉",
81-
"valid": false
82-
},
83-
{
84-
"description": "doesn't match two",
85-
"data": "🐉🐉",
86-
"valid": false
87-
},
88-
{
89-
"description": "doesn't match one ASCII",
90-
"data": "D",
91-
"valid": false
92-
},
93-
{
94-
"description": "doesn't match two ASCII",
95-
"data": "DD",
96-
"valid": false
97-
}
98-
]
9958
}
10059
]

tests/draft2019-09/patternProperties.json

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -147,42 +147,5 @@
147147
"valid": true
148148
}
149149
]
150-
},
151-
{
152-
"description": "non-BMP, checks for proper surrogate pair handling for UTF-16",
153-
"schema": {
154-
"patternProperties": {
155-
"^🐲*$": {
156-
"type": "integer"
157-
}
158-
}
159-
},
160-
"tests": [
161-
{
162-
"description": "matches empty",
163-
"data": { "": 1 },
164-
"valid": true
165-
},
166-
{
167-
"description": "matches single",
168-
"data": { "🐲": 1 },
169-
"valid": true
170-
},
171-
{
172-
"description": "matches two",
173-
"data": { "🐲🐲": 1 },
174-
"valid": true
175-
},
176-
{
177-
"description": "doesn't match one",
178-
"data": { "🐲": "hello" },
179-
"valid": false
180-
},
181-
{
182-
"description": "doesn't match two",
183-
"data": { "🐲🐲": "hello" },
184-
"valid": false
185-
}
186-
]
187150
}
188151
]
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[
2+
{
3+
"description": "Proper UTF-16 surrogate pair handling: pattern",
4+
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
5+
"schema": { "pattern": "^🐲*$" },
6+
"tests": [
7+
{
8+
"description": "matches empty",
9+
"data": "",
10+
"valid": true
11+
},
12+
{
13+
"description": "matches single",
14+
"data": "🐲",
15+
"valid": true
16+
},
17+
{
18+
"description": "matches two",
19+
"data": "🐲🐲",
20+
"valid": true
21+
},
22+
{
23+
"description": "doesn't match one",
24+
"data": "🐉",
25+
"valid": false
26+
},
27+
{
28+
"description": "doesn't match two",
29+
"data": "🐉🐉",
30+
"valid": false
31+
},
32+
{
33+
"description": "doesn't match one ASCII",
34+
"data": "D",
35+
"valid": false
36+
},
37+
{
38+
"description": "doesn't match two ASCII",
39+
"data": "DD",
40+
"valid": false
41+
}
42+
]
43+
},
44+
{
45+
"description": "Proper UTF-16 surrogate pair handling: patternProperties",
46+
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
47+
"schema": {
48+
"patternProperties": {
49+
"^🐲*$": {
50+
"type": "integer"
51+
}
52+
}
53+
},
54+
"tests": [
55+
{
56+
"description": "matches empty",
57+
"data": { "": 1 },
58+
"valid": true
59+
},
60+
{
61+
"description": "matches single",
62+
"data": { "🐲": 1 },
63+
"valid": true
64+
},
65+
{
66+
"description": "matches two",
67+
"data": { "🐲🐲": 1 },
68+
"valid": true
69+
},
70+
{
71+
"description": "doesn't match one",
72+
"data": { "🐲": "hello" },
73+
"valid": false
74+
},
75+
{
76+
"description": "doesn't match two",
77+
"data": { "🐲🐲": "hello" },
78+
"valid": false
79+
}
80+
]
81+
}
82+
]

tests/draft3/pattern.json

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -55,46 +55,5 @@
5555
"valid": true
5656
}
5757
]
58-
},
59-
{
60-
"description": "non-BMP, checks for proper surrogate pair handling for UTF-16",
61-
"schema": { "pattern": "^🐲*$" },
62-
"tests": [
63-
{
64-
"description": "matches empty",
65-
"data": "",
66-
"valid": true
67-
},
68-
{
69-
"description": "matches single",
70-
"data": "🐲",
71-
"valid": true
72-
},
73-
{
74-
"description": "matches two",
75-
"data": "🐲🐲",
76-
"valid": true
77-
},
78-
{
79-
"description": "doesn't match one",
80-
"data": "🐉",
81-
"valid": false
82-
},
83-
{
84-
"description": "doesn't match two",
85-
"data": "🐉🐉",
86-
"valid": false
87-
},
88-
{
89-
"description": "doesn't match one ASCII",
90-
"data": "D",
91-
"valid": false
92-
},
93-
{
94-
"description": "doesn't match two ASCII",
95-
"data": "DD",
96-
"valid": false
97-
}
98-
]
9958
}
10059
]

tests/draft3/patternProperties.json

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -111,42 +111,5 @@
111111
"valid": false
112112
}
113113
]
114-
},
115-
{
116-
"description": "non-BMP, checks for proper surrogate pair handling for UTF-16",
117-
"schema": {
118-
"patternProperties": {
119-
"^🐲*$": {
120-
"type": "integer"
121-
}
122-
}
123-
},
124-
"tests": [
125-
{
126-
"description": "matches empty",
127-
"data": { "": 1 },
128-
"valid": true
129-
},
130-
{
131-
"description": "matches single",
132-
"data": { "🐲": 1 },
133-
"valid": true
134-
},
135-
{
136-
"description": "matches two",
137-
"data": { "🐲🐲": 1 },
138-
"valid": true
139-
},
140-
{
141-
"description": "doesn't match one",
142-
"data": { "🐲": "hello" },
143-
"valid": false
144-
},
145-
{
146-
"description": "doesn't match two",
147-
"data": { "🐲🐲": "hello" },
148-
"valid": false
149-
}
150-
]
151114
}
152115
]

0 commit comments

Comments
 (0)