Skip to content

Commit

Permalink
Add a test for --remap-path-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinFinck committed Jan 8, 2025
1 parent 9f9df6f commit 59a07ad
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/compiler/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3798,6 +3798,34 @@ proc_macro false
assert_eq!(h.gcno, Some("foo-a1b6419f8321841f.gcno".into()));
}

#[test]
fn test_parse_remap_path_prefix() {
let h = parses!(
"--crate-name",
"foo",
"--crate-type",
"lib",
"./src/lib.rs",
"--emit=dep-info,link",
"--out-dir",
"/out",
"--remap-path-prefix",
"/home/test=~",
"--remap-path-prefix",
"/root=~"
);
assert!(h.arguments.contains(&Argument::WithValue(
"--remap-path-prefix",
ArgData::PassThrough(OsString::from("/home/test=~")),
ArgDisposition::Separated
)));
assert!(h.arguments.contains(&Argument::WithValue(
"--remap-path-prefix",
ArgData::PassThrough(OsString::from("/root=~")),
ArgDisposition::Separated
)));
}

#[test]
fn test_parse_target() {
// Parse a --target argument that is a string (not a path to a .json file).
Expand Down

0 comments on commit 59a07ad

Please sign in to comment.