Skip to content

Commit b8611c4

Browse files
committed
Extend URI and URI-reference tests
Add tests that check if the URI contains invalid characters.
1 parent 48461fc commit b8611c4

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

tests/draft-next/optional/format/uri-reference.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@
7070
"description": "an invalid URI fragment",
7171
"data": "#frag\\ment",
7272
"valid": false
73+
},
74+
{
75+
"description": "unescaped non US-ASCII characters",
76+
"data": "/foobar®.txt",
77+
"valid": false
78+
},
79+
{
80+
"description": "invalid backslash character",
81+
"data": "https://example.org/foobar\\.txt",
82+
"valid": false
7383
}
7484
]
7585
}

tests/draft-next/optional/format/uri.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,56 @@
135135
"description": "an invalid URI with comma in scheme",
136136
"data": "bar,baz:foo",
137137
"valid": false
138+
},
139+
{
140+
"description": "invalid userinfo",
141+
"data": "https://[@example.org/test.txt",
142+
"valid": false
143+
},
144+
{
145+
"description": "unescaped non US-ASCII characters",
146+
"data": "https://example.org/foobar®.txt",
147+
"valid": false
148+
},
149+
{
150+
"description": "invalid backslash character",
151+
"data": "https://example.org/foobar\\.txt",
152+
"valid": false
153+
},
154+
{
155+
"description": "invalid \" character",
156+
"data": "https://example.org/foobar\".txt",
157+
"valid": false
158+
},
159+
{
160+
"description": "invalid <> characters",
161+
"data": "https://example.org/foobar<>.txt",
162+
"valid": false
163+
},
164+
{
165+
"description": "invalid {} characters",
166+
"data": "https://example.org/foobar{}.txt",
167+
"valid": false
168+
},
169+
{
170+
"description": "invalid ^ character",
171+
"data": "https://example.org/foobar^.txt",
172+
"valid": false
173+
},
174+
{
175+
"description": "invalid ` character",
176+
"data": "https://example.org/foobar`.txt",
177+
"valid": false
178+
},
179+
{
180+
"description": "invalid SPACE character",
181+
"data": "https://example.org/foo bar.txt",
182+
"valid": false
183+
},
184+
{
185+
"description": "invalid | character",
186+
"data": "https://example.org/foobar|.txt",
187+
"valid": false
138188
}
139189
]
140190
}

0 commit comments

Comments
 (0)