File tree 2 files changed +1240
-228
lines changed
2 files changed +1240
-228
lines changed Original file line number Diff line number Diff line change @@ -15,42 +15,32 @@ use url::{quirks, Url};
15
15
16
16
#[ test]
17
17
fn urltestdata ( ) {
18
- let idna_skip_inputs = [
19
- "http://www.foo。bar.com" ,
20
- "http://Go.com" ,
21
- "http://你好你好" ,
22
- "https://faß.ExAmPlE/" ,
23
- "http://0Xc0.0250.01" ,
24
- "ftp://%e2%98%83" ,
25
- "https://%e2%98%83" ,
26
- "file://a\u{ad} b/p" ,
27
- "file://a%C2%ADb/p" ,
28
- "http://GOO\u{200b} \u{2060} \u{feff} goo.com" ,
29
- ] ;
30
-
31
18
// Copied from https://github.com/web-platform-tests/wpt/blob/master/url/
32
19
let mut json = Value :: from_str ( include_str ! ( "urltestdata.json" ) )
33
20
. expect ( "JSON parse error in urltestdata.json" ) ;
34
21
35
22
let mut passed = true ;
23
+ let mut skip_next = false ;
36
24
for entry in json. as_array_mut ( ) . unwrap ( ) {
37
25
if entry. is_string ( ) {
26
+ if entry. as_str ( ) . unwrap ( ) == "skip next" {
27
+ skip_next = true ;
28
+ }
38
29
continue ; // ignore comments
39
30
}
40
31
32
+ if skip_next {
33
+ skip_next = false ;
34
+ continue ;
35
+ }
36
+
41
37
let maybe_base = entry
42
38
. take_key ( "base" )
43
39
. expect ( "missing base key" )
44
40
. maybe_string ( ) ;
45
41
let input = entry. take_string ( "input" ) ;
46
42
let failure = entry. take_key ( "failure" ) . is_some ( ) ;
47
43
48
- {
49
- if idna_skip_inputs. contains ( & input. as_str ( ) ) {
50
- continue ;
51
- }
52
- }
53
-
54
44
let res = if let Some ( base) = maybe_base {
55
45
let base = match Url :: parse ( & base) {
56
46
Ok ( base) => base,
You can’t perform that action at this time.
0 commit comments