forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.rs
32 lines (29 loc) · 832 Bytes
/
tests.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use super::*;
#[test]
fn test_rpaths_to_args() {
let mut cmd = Command::new("foo");
convert_link_args_to_cc_args(&mut cmd, &["-rpath", "path1", "-rpath", "path2"]);
assert_eq!(cmd.get_args(), [OsStr::new("-Wl,-rpath,path1,-rpath,path2")]);
}
#[test]
fn test_xlinker() {
let mut cmd = Command::new("foo");
convert_link_args_to_cc_args(&mut cmd, &[
"arg1",
"arg2",
"arg3,with,comma",
"arg4,with,comma",
"arg5",
"arg6,with,comma",
]);
assert_eq!(cmd.get_args(), [
OsStr::new("-Wl,arg1,arg2"),
OsStr::new("-Xlinker"),
OsStr::new("arg3,with,comma"),
OsStr::new("-Xlinker"),
OsStr::new("arg4,with,comma"),
OsStr::new("-Wl,arg5"),
OsStr::new("-Xlinker"),
OsStr::new("arg6,with,comma"),
]);
}