Skip to main content

test_uri

Function test_uri 

Source
pub fn test_uri(unix_path: &str) -> Uri
Expand description

Builds a [Uri] from a Unix-style absolute test path.

On Windows, a synthetic C: drive is prefixed so the path is recognized as absolute; on other platforms the path is used as-is.

§Panics

Panics if the resulting path is not a valid file URI. This is a test helper: fixture paths are expected to always be well-formed.

§Examples

use deps_core::test_util::test_uri;

let uri = test_uri("/project/Cargo.toml");
assert!(uri.path().as_str().ends_with("Cargo.toml"));