فهرست منبع

Auto merge of #260 - servo:idna-test_, r=SimonSapin

Fix idna tests to ignore validity criteria 2, run on travis

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/260)
<!-- Reviewable:end -->
bors-servo 9 سال پیش
والد
کامیت
d05061f4ab
3فایلهای تغییر یافته به همراه11 افزوده شده و 0 حذف شده
  1. 3 0
      Cargo.toml
  2. 1 0
      Makefile
  3. 7 0
      idna/tests/uts46.rs

+ 3 - 0
Cargo.toml

@@ -11,6 +11,9 @@ readme = "README.md"
 keywords = ["url", "parser"]
 keywords = ["url", "parser"]
 license = "MIT/Apache-2.0"
 license = "MIT/Apache-2.0"
 
 
+[workspace]
+members = [".", "idna"]
+
 [[test]]
 [[test]]
 name = "unit"
 name = "unit"
 
 

+ 1 - 0
Makefile

@@ -1,5 +1,6 @@
 test:
 test:
 	cargo test --features "query_encoding serde rustc-serialize"
 	cargo test --features "query_encoding serde rustc-serialize"
 	[ x$$TRAVIS_RUST_VERSION != xnightly ] || cargo test --features heapsize
 	[ x$$TRAVIS_RUST_VERSION != xnightly ] || cargo test --features heapsize
+	(cd idna && cargo test)
 
 
 .PHONY: test
 .PHONY: test

+ 7 - 0
idna/tests/uts46.rs

@@ -56,6 +56,13 @@ pub fn collect_tests<F: FnMut(String, TestFn)>(add_test: &mut F) {
                     // for these contexts
                     // for these contexts
                     return;
                     return;
                 }
                 }
+                if to_ascii == "[V2]" {
+                    // Everybody ignores V2
+                    // https://github.com/servo/rust-url/pull/240
+                    // https://github.com/whatwg/url/issues/53#issuecomment-181528158
+                    // http://www.unicode.org/review/pri317/
+                    return;
+                }
                 let res = result.ok();
                 let res = result.ok();
                 assert!(res == None, "Expected error. result: {} | original: {} | source: {}",
                 assert!(res == None, "Expected error. result: {} | original: {} | source: {}",
                         res.unwrap(), original, source);
                         res.unwrap(), original, source);