Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New IntoUrl trait #177

Closed
wants to merge 40 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
918352b
Make it possible to define new encode sets in other crates.
SimonSapin Dec 4, 2015
db9de70
Define encode sets based on another set.
SimonSapin Dec 4, 2015
691aec2
Remove the HTTP_VALUE encode set. It can be defined in another crate.
SimonSapin Dec 4, 2015
d140dc8
Rewrite ALL THE THINGS!
SimonSapin Dec 9, 2015
9edff44
Remove the dependency on uuid.
SimonSapin Feb 8, 2016
576bd2a
Add URL slicing/indexing by component.
SimonSapin Feb 8, 2016
7b11445
Add stubs with partial implementation for the WebIDL API.
SimonSapin Feb 8, 2016
c617ed1
Shorter Cargo.toml syntax.
SimonSapin Feb 8, 2016
22cf104
serde_serialization -> serde
SimonSapin Feb 8, 2016
0cb3f2b
Make rustc-serialize an optional dependency.
SimonSapin Feb 8, 2016
61a8185
Rename *{Start,End} posititons to {Before,After}*
SimonSapin Feb 9, 2016
813d270
Replace from_hex() with char::to_digit(16)
SimonSapin Feb 9, 2016
0b5ffb4
Make percent-decoding an iterator.
SimonSapin Feb 9, 2016
244d999
Make percent-encoding an iterator.
SimonSapin Feb 9, 2016
7b33b33
Add percent-encoding convienience wrappers.
SimonSapin Feb 9, 2016
ca9f87d
Update tests from https://github.com/w3c/web-platform-tests/blob/mast…
SimonSapin Feb 10, 2016
7a0e467
Remove Url::has_host
SimonSapin Feb 11, 2016
9a8d394
Remove unused ParseError variants
SimonSapin Feb 12, 2016
903f1d2
Make context a field of Parser.
SimonSapin Feb 11, 2016
a9b4e71
Remove the redundant is_relative field.
SimonSapin Feb 15, 2016
ded48a2
Add Url::domain and Url::ip_address
SimonSapin Feb 15, 2016
d3dba86
Implement ToSocketAddrs
SimonSapin Feb 15, 2016
088c3ed
Remove Url::ip_address for now
SimonSapin Feb 15, 2016
641f940
Add Unicode and ASCII serializations of origins
SimonSapin Feb 16, 2016
946d950
Test WebIdl::origin
SimonSapin Feb 16, 2016
4dff876
Add a fragment setter
SimonSapin Feb 11, 2016
0ae07ed
Add a query setter.
SimonSapin Feb 12, 2016
542feb0
Make Url::parse_with usable. (EncodingOverride is private.)
SimonSapin Feb 19, 2016
dd0436a
Add Origin::is_tuple
SimonSapin Feb 19, 2016
f7e0d7c
More consistent checks for URL with authority or path-only.
SimonSapin Feb 19, 2016
fd16b74
Re-export OpaqueOrigin. It is exposed publicly through Origin::Opaque
SimonSapin Feb 19, 2016
f1bdaa6
Add a scheme setter
SimonSapin Feb 19, 2016
158145f
Add host setters.
SimonSapin Feb 19, 2016
b1b0916
More setters
SimonSapin Feb 23, 2016
47e31ef
Add a path setter
SimonSapin Feb 26, 2016
e7a4dc0
Username and passowrd setters
SimonSapin Feb 26, 2016
5b26c89
More WebIDL implementations.
SimonSapin Feb 26, 2016
bf0f670
Port setters
SimonSapin Mar 1, 2016
b89d7d7
All setters.
SimonSapin Mar 1, 2016
3f9dcd4
New IntoUrl trait
cmbrandenburg Mar 4, 2016
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Test WebIdl::origin

  • Loading branch information
SimonSapin committed Mar 3, 2016
commit 946d9507ec4d569bb402607321c03ace4a3b86da
@@ -919,7 +919,6 @@
"input": "file:/example.com/",
"base": "http://example.org/foo/bar",
"href": "file:///example.com/",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1295,7 +1294,6 @@
"input": "file:c:\\foo\\bar.html",
"base": "file:///tmp/mock/path",
"href": "file:///c:/foo/bar.html",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1310,7 +1308,6 @@
"input": " File:c|////foo\\bar.html",
"base": "file:///tmp/mock/path",
"href": "file:///c:////foo/bar.html",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1325,7 +1322,6 @@
"input": "C|/foo/bar",
"base": "file:///tmp/mock/path",
"href": "file:///C:/foo/bar",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1340,7 +1336,6 @@
"input": "/C|\\foo\\bar",
"base": "file:///tmp/mock/path",
"href": "file:///C:/foo/bar",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1355,7 +1350,6 @@
"input": "//C|/foo/bar",
"base": "file:///tmp/mock/path",
"href": "file:///C:/foo/bar",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1370,7 +1364,6 @@
"input": "//server/file",
"base": "file:///tmp/mock/path",
"href": "file://server/file",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1385,7 +1378,6 @@
"input": "\\\\server\\file",
"base": "file:///tmp/mock/path",
"href": "file://server/file",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1400,7 +1392,6 @@
"input": "/\\server/file",
"base": "file:///tmp/mock/path",
"href": "file://server/file",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1415,7 +1406,6 @@
"input": "file:///foo/bar.txt",
"base": "file:///tmp/mock/path",
"href": "file:///foo/bar.txt",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1430,7 +1420,6 @@
"input": "file:///home/me",
"base": "file:///tmp/mock/path",
"href": "file:///home/me",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1445,7 +1434,6 @@
"input": "//",
"base": "file:///tmp/mock/path",
"href": "file:///",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1460,7 +1448,6 @@
"input": "///",
"base": "file:///tmp/mock/path",
"href": "file:///",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1475,7 +1462,6 @@
"input": "///test",
"base": "file:///tmp/mock/path",
"href": "file:///test",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1490,7 +1476,6 @@
"input": "file://test",
"base": "file:///tmp/mock/path",
"href": "file://test/",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1505,7 +1490,6 @@
"input": "file://localhost",
"base": "file:///tmp/mock/path",
"href": "file:///",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1520,7 +1504,6 @@
"input": "file://localhost/",
"base": "file:///tmp/mock/path",
"href": "file:///",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1535,7 +1518,6 @@
"input": "file://localhost/test",
"base": "file:///tmp/mock/path",
"href": "file:///test",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1550,7 +1532,6 @@
"input": "test",
"base": "file:///tmp/mock/path",
"href": "file:///tmp/mock/test",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -1565,7 +1546,6 @@
"input": "file:test",
"base": "file:///tmp/mock/path",
"href": "file:///tmp/mock/test",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -2587,7 +2567,6 @@
"input": "file:/example.com/",
"base": "about:blank",
"href": "file:///example.com/",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -3344,7 +3323,6 @@
"input": "file:...",
"base": "http://www.example.com/test",
"href": "file:///...",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -3359,7 +3337,6 @@
"input": "file:..",
"base": "http://www.example.com/test",
"href": "file:///",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -3374,7 +3351,6 @@
"input": "file:a",
"base": "http://www.example.com/test",
"href": "file:///a",
"origin": "file://",
"protocol": "file:",
"username": "",
"password": "",
@@ -29,17 +29,20 @@ fn run_one(input: String, base: String, expected: Result<TestCase, ()>) {
};

macro_rules! assert_getter {
($attribute: ident) => {
($attribute: ident) => { assert_getter!($attribute, expected.$attribute) };
($attribute: ident, $expected: expr) => {
{
let a = WebIdl::$attribute(&url);
let b = expected.$attribute;
let b = $expected;
assert!(a == b, "{:?} != {:?} for URL {:?}", a, b, url);
}
}
}

assert_getter!(href);
//assert_getter!(origin); FIXME
if let Some(expected_origin) = expected.origin {
assert_getter!(origin, expected_origin);
}
assert_getter!(protocol);
assert_getter!(username);
assert_getter!(password);
@@ -53,7 +56,7 @@ fn run_one(input: String, base: String, expected: Result<TestCase, ()>) {

struct TestCase {
href: String,
origin: String,
origin: Option<String>,
protocol: String,
username: String,
password: String,
@@ -80,7 +83,7 @@ fn main() {
} else {
Ok(TestCase {
href: string("href"),
origin: string("origin"),
origin: entry.find("origin").map(|j| j.as_string().unwrap().to_owned()),
protocol: string("protocol"),
username: string("username"),
password: string("password"),
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.