File tree Expand file tree Collapse file tree 2 files changed +1240
-228
lines changed Expand file tree Collapse file tree 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};
1515
1616#[ test]
1717fn 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-
3118 // Copied from https://github.com/web-platform-tests/wpt/blob/master/url/
3219 let mut json = Value :: from_str ( include_str ! ( "urltestdata.json" ) )
3320 . expect ( "JSON parse error in urltestdata.json" ) ;
3421
3522 let mut passed = true ;
23+ let mut skip_next = false ;
3624 for entry in json. as_array_mut ( ) . unwrap ( ) {
3725 if entry. is_string ( ) {
26+ if entry. as_str ( ) . unwrap ( ) == "skip next" {
27+ skip_next = true ;
28+ }
3829 continue ; // ignore comments
3930 }
4031
32+ if skip_next {
33+ skip_next = false ;
34+ continue ;
35+ }
36+
4137 let maybe_base = entry
4238 . take_key ( "base" )
4339 . expect ( "missing base key" )
4440 . maybe_string ( ) ;
4541 let input = entry. take_string ( "input" ) ;
4642 let failure = entry. take_key ( "failure" ) . is_some ( ) ;
4743
48- {
49- if idna_skip_inputs. contains ( & input. as_str ( ) ) {
50- continue ;
51- }
52- }
53-
5444 let res = if let Some ( base) = maybe_base {
5545 let base = match Url :: parse ( & base) {
5646 Ok ( base) => base,
You can’t perform that action at this time.
0 commit comments