Skip to content

Commit 96fce77

Browse files
author
Audran Doublet
committed
msvc: mozilla#1687: add unit test
1 parent ea61a46 commit 96fce77

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/compiler/msvc.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,38 @@ mod test {
18061806
assert!(msvc_show_includes);
18071807
}
18081808

1809+
#[test]
1810+
fn parse_argument_output_file_trailing_backslash() {
1811+
let args = ovec!["-c", "foo.c", "/Fomyrelease\\folder\\"];
1812+
let ParsedArguments {
1813+
input,
1814+
language,
1815+
outputs,
1816+
preprocessor_args,
1817+
msvc_show_includes,
1818+
common_args,
1819+
..
1820+
} = match parse_arguments(args) {
1821+
CompilerArguments::Ok(args) => args,
1822+
o => panic!("Got unexpected parse result: {:?}", o),
1823+
};
1824+
assert_eq!(Some("foo.c"), input.to_str());
1825+
assert_eq!(Language::C, language);
1826+
assert_map_contains!(
1827+
outputs,
1828+
(
1829+
"obj",
1830+
ArtifactDescriptor {
1831+
path: PathBuf::from("myrelease/folder/foo.obj"),
1832+
optional: false
1833+
}
1834+
)
1835+
);
1836+
assert!(preprocessor_args.is_empty());
1837+
assert!(common_args.is_empty());
1838+
assert!(!msvc_show_includes);
1839+
}
1840+
18091841
#[test]
18101842
fn test_parse_arguments_pdb() {
18111843
let args = ovec!["-c", "foo.c", "-Zi", "-Fdfoo.pdb", "-Fofoo.obj"];

0 commit comments

Comments
 (0)