-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test-cargo-miri: normalize slashes before comparing paths
- Loading branch information
Showing
3 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
println!("subcrate testing"); | ||
|
||
let env_dir = env::current_dir().unwrap(); | ||
let crate_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); | ||
// CWD should be crate root. | ||
// We have to normalize slashes, as the env var might be set for a different target's conventions. | ||
let env_dir = env::current_dir().unwrap(); | ||
let env_dir = env_dir.to_string_lossy().replace("\\", "/"); | ||
let crate_dir = env::var_os("CARGO_MANIFEST_DIR").unwrap(); | ||
let crate_dir = crate_dir.to_string_lossy().replace("\\", "/"); | ||
assert_eq!(env_dir, crate_dir); | ||
} |