frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

sparse-http test failing localy #126

Closed ToBinio closed 1 year ago

ToBinio commented 1 year ago

I am running into a minor problem with the sparse-http tests.

Problem

The URI to String conversions is locally(Windows) a bit off. It creates Uri like this: https://index.crates.io/se\rd\serde in practice this isn't a problem because most if not all client can handle such problems but the test don't.

https://github.com/frewsxcv/rust-crates-index/blob/e0157d00a2fd4cc7652be81f9529b553314c8463/src/sparse_index.rs#L324

so the test always fails with:

thread 'sparse_index::http_tests::generates_request_for_local_cache_entry' panicked at 'assertion failed: `(left == right)`
  left: `https://index.crates.io/au\to\autocfg`,
 right: `"https://index.crates.io/au/to/autocfg"`', src\sparse_index.rs:332:9

Solution

The question now is if this should be fixed and if so how.

Byron commented 1 year ago

Could you retry this with the latest version? It's probably still an issue though, and if you have a fix I'd be happy merge a PR. At that time I would take the liberty to also add windows CI runners to prevent regressions.