diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 199eb8654..df152a9d3 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -3,7 +3,6 @@ name: Coverage on: push: branches: ["main"] - pull_request: jobs: coverage: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d3b2499e..19e23f3ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,8 +14,8 @@ jobs: Test: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - rust: [1.63.0, 1.82.0, stable, beta, nightly] + os: [windows-latest] + rust: [stable] exclude: - os: macos-latest rust: 1.82.0 @@ -51,7 +51,7 @@ jobs: - run: cargo build --all-targets # Run tests - name: Run tests - run: cargo test + run: cargo test test_url_parsing # Run tests enabling the serde feature - name: Run tests with the serde feature run: cargo test --features "url/serde,url/expose_internals" diff --git a/.gitignore b/.gitignore index 0284c25cc..c1ead9bef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ target Cargo.lock /.cargo/config +.DS_Store diff --git a/url/Cargo.toml b/url/Cargo.toml index 193364f34..4f0dcf1fc 100644 --- a/url/Cargo.toml +++ b/url/Cargo.toml @@ -14,12 +14,13 @@ categories = ["parser-implementations", "web-programming", "encoding", "no-std"] license = "MIT OR Apache-2.0" include = ["src/**/*", "LICENSE-*", "README.md", "tests/**"] edition = "2018" -rust-version = "1.63" # From libc +rust-version = "1.63" # From libc [dev-dependencies] serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" bencher = "0.1" +tempfile = { version = "3" } [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/url/tests/unit.rs b/url/tests/unit.rs index a5298003c..06e2b3c15 100644 --- a/url/tests/unit.rs +++ b/url/tests/unit.rs @@ -1383,3 +1383,19 @@ fn serde_error_message() { r#"relative URL without a base: "§invalid#+#*Ä" at line 1 column 25"# ); } + +// https://github.com/servo/rust-url/issues/1077 +#[cfg(feature = "std")] +#[test] +fn test_url_parsing() { + let tmpdir = tempfile::tempdir().unwrap(); + let tmp_path = tmpdir.path().to_str().unwrap(); + let tmp_path = tmp_path.replace("\\", "%5C"); + let mut url = url::Url::parse("file://").unwrap(); + url.path_segments_mut() + .unwrap() + .pop_if_empty() + .extend(std::iter::once(tmp_path)); + dbg!(&url); + url.to_file_path().unwrap(); +}