Skip to content

Commit

Permalink
add another --emit parsing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnatsel committed Nov 23, 2024
1 parent abbb29f commit 0431135
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cargo-auditable/src/rustc_arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,27 @@ mod tests {
assert!(should_embed_audit_data(&args));
}

#[test]
fn multiple_emit_values() {
let raw_rustc_args = vec![
"--emit=dep-info,link",
"--emit",
"llvm-bc",
// end of interesting args, start of boilerplate
"--crate-name",
"foobar",
"--out-dir",
"/foo/bar",
];
let raw_rustc_args: Vec<OsString> = raw_rustc_args.into_iter().map(|s| s.into()).collect();
let mut args = RustcArgs::from_vec(raw_rustc_args).unwrap();

let expected = vec!["dep-info", "link", "llvm-bc"];
let mut expected: Vec<String> = expected.into_iter().map(|s| s.into()).collect();

args.emit.sort();
expected.sort();

assert_eq!(args.emit, expected)
}
}

0 comments on commit 0431135

Please sign in to comment.