Corey Farwell 2015-11-20 08:58:01 -05:00
parent 0146751bb2
commit f34da4120d
30 changed files with 346 additions and 128 deletions

View file

@ -0,0 +1,15 @@
[package]
name = "plugin_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
[lib]
name = "plugin_tests"
path = "lib.rs"
doctest = false
[dependencies.plugins]
path = "../../../components/plugins"
[dependencies.url]
version = "0.2.36"

11
tests/unit/plugin/lib.rs Normal file
View file

@ -0,0 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#![feature(plugin)]
#![plugin(plugins)]
extern crate url;
#[cfg(test)]
mod url_plugin;

View file

@ -0,0 +1,24 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#[test]
fn test_url_plugin() {
assert_eq!("ftp://google.com/",
url!("ftp://google.com").to_string());
assert_eq!("ftp://google.com:443/",
url!("ftp://google.com:443").to_string());
assert_eq!("ftp://google.com:443/a/b/c",
url!("ftp://google.com:443/a/b/c").to_string());
assert_eq!("ftp://google.com:443/?a=b&c=d",
url!("ftp://google.com:443?a=b&c=d").to_string());
assert_eq!("http://[2001::1]/",
url!("http://[2001::1]:80").to_string());
assert_eq!("about:blank",
url!("about:blank").to_string());
}