Debian Codegraph @

share/tests/draft2020-12/optional/non-bmp-regex.json

raw
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": {
6 "$schema": "https://json-schema.org/draft/2020-12/schema",
7 "pattern": "^🐲*$"
8 },
9 "tests": [
10 {
11 "description": "matches empty",
12 "data": "",
13 "valid": true
14 },
15 {
16 "description": "matches single",
17 "data": "🐲",
18 "valid": true
19 },
20 {
21 "description": "matches two",
22 "data": "🐲🐲",
23 "valid": true
24 },
25 {
26 "description": "doesn't match one",
27 "data": "🐉",
28 "valid": false
29 },
30 {
31 "description": "doesn't match two",
32 "data": "🐉🐉",
33 "valid": false
34 },
35 {
36 "description": "doesn't match one ASCII",
37 "data": "D",
38 "valid": false
39 },
40 {
41 "description": "doesn't match two ASCII",
42 "data": "DD",
43 "valid": false
44 }
45 ]
46 },
47 {
48 "description": "Proper UTF-16 surrogate pair handling: patternProperties",
49 "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
50 "schema": {
51 "$schema": "https://json-schema.org/draft/2020-12/schema",
52 "patternProperties": {
53 "^🐲*$": {
54 "type": "integer"
55 }
56 }
57 },
58 "tests": [
59 {
60 "description": "matches empty",
61 "data": { "": 1 },
62 "valid": true
63 },
64 {
65 "description": "matches single",
66 "data": { "🐲": 1 },
67 "valid": true
68 },
69 {
70 "description": "matches two",
71 "data": { "🐲🐲": 1 },
72 "valid": true
73 },
74 {
75 "description": "doesn't match one",
76 "data": { "🐲": "hello" },
77 "valid": false
78 },
79 {
80 "description": "doesn't match two",
81 "data": { "🐲🐲": "hello" },
82 "valid": false
83 }
84 ]
85 }
86 ]