aboutsummaryrefslogtreecommitdiffstats
path: root/components/net_traits/tests
diff options
context:
space:
mode:
authorPaul Rouget <me@paulrouget.com>2018-04-30 22:19:33 +0800
committerPaul Rouget <me@paulrouget.com>2018-04-30 22:19:33 +0800
commite02a23b2f6b8b1d8386f46e73068bdd48a6811f5 (patch)
treeb8d5dead3d40919cfa3c685f86503bca16d888fe /components/net_traits/tests
parentbf667677f75cd3f56fff3a91f73c21ba1e4705af (diff)
downloadservo-e02a23b2f6b8b1d8386f46e73068bdd48a6811f5.tar.gz
servo-e02a23b2f6b8b1d8386f46e73068bdd48a6811f5.zip
Automatically provide a resource reader for tests
Diffstat (limited to 'components/net_traits/tests')
-rw-r--r--components/net_traits/tests/pub_domains.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/components/net_traits/tests/pub_domains.rs b/components/net_traits/tests/pub_domains.rs
index c5fa0135db2..fa298633f6c 100644
--- a/components/net_traits/tests/pub_domains.rs
+++ b/components/net_traits/tests/pub_domains.rs
@@ -2,17 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-extern crate embedder_traits;
extern crate net_traits;
-use embedder_traits::resources::register_resources_for_tests;
use net_traits::pub_domains::{is_pub_domain, is_reg_domain, pub_suffix, reg_suffix};
// These tests may need to be updated if the PSL changes.
#[test]
fn test_is_pub_domain_plain() {
- register_resources_for_tests();
assert!(is_pub_domain("com"));
assert!(is_pub_domain(".org"));
assert!(is_pub_domain("za.org"));
@@ -22,7 +19,6 @@ fn test_is_pub_domain_plain() {
#[test]
fn test_is_pub_domain_wildcard() {
- register_resources_for_tests();
assert!(is_pub_domain("hello.bd"));
assert!(is_pub_domain("world.jm"));
assert!(is_pub_domain("toto.kobe.jp"));
@@ -30,7 +26,6 @@ fn test_is_pub_domain_wildcard() {
#[test]
fn test_is_pub_domain_exception() {
- register_resources_for_tests();
assert_eq!(is_pub_domain("www.ck"), false);
assert_eq!(is_pub_domain("city.kawasaki.jp"), false);
assert_eq!(is_pub_domain("city.nagoya.jp"), false);
@@ -39,7 +34,6 @@ fn test_is_pub_domain_exception() {
#[test]
fn test_is_pub_domain_not() {
- register_resources_for_tests();
assert_eq!(is_pub_domain(""), false);
assert_eq!(is_pub_domain("."), false);
assert_eq!(is_pub_domain("..."), false);
@@ -52,7 +46,6 @@ fn test_is_pub_domain_not() {
#[test]
fn test_is_pub_domain() {
- register_resources_for_tests();
assert!(!is_pub_domain("city.yokohama.jp"));
assert!(!is_pub_domain("foo.bar.baz.yokohama.jp"));
assert!(!is_pub_domain("foo.bar.city.yokohama.jp"));
@@ -71,7 +64,6 @@ fn test_is_pub_domain() {
#[test]
fn test_is_reg_domain() {
- register_resources_for_tests();
assert!(!is_reg_domain("com"));
assert!(!is_reg_domain("foo.bar.baz.yokohama.jp"));
assert!(!is_reg_domain("foo.bar.com"));
@@ -89,7 +81,6 @@ fn test_is_reg_domain() {
#[test]
fn test_pub_suffix() {
- register_resources_for_tests();
assert_eq!(pub_suffix("city.yokohama.jp"), "yokohama.jp");
assert_eq!(pub_suffix("com"), "com");
assert_eq!(pub_suffix("foo.bar.baz.yokohama.jp"), "baz.yokohama.jp");
@@ -107,7 +98,6 @@ fn test_pub_suffix() {
#[test]
fn test_reg_suffix() {
- register_resources_for_tests();
assert_eq!(reg_suffix("city.yokohama.jp"), "city.yokohama.jp");
assert_eq!(reg_suffix("com"), "com");
assert_eq!(reg_suffix("foo.bar.baz.yokohama.jp"), "bar.baz.yokohama.jp");
@@ -125,7 +115,6 @@ fn test_reg_suffix() {
#[test]
fn test_weirdness() {
- register_resources_for_tests();
// These are weird results, but AFAICT they are spec-compliant.
assert_ne!(pub_suffix("city.yokohama.jp"), pub_suffix(pub_suffix("city.yokohama.jp")));
assert!(!is_pub_domain(pub_suffix("city.yokohama.jp")));