Skip to content

Commit dc6b5be

Browse files
committed
Simplify tool_paths::absolute_tools test
... by reusing the new [ROOT] macro.
1 parent 092f7ba commit dc6b5be

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

tests/testsuite/tool_paths.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ fn pathless_tools() {
3333
#[test]
3434
fn absolute_tools() {
3535
let target = rustc_host();
36-
let root = if cfg!(windows) { r#"C:\"# } else { "/" };
3736

3837
// Escaped as they appear within a TOML config file
3938
let config = if cfg!(windows) {
@@ -62,14 +61,11 @@ fn absolute_tools() {
6261
),
6362
).build();
6463

65-
foo.cargo("build --verbose").with_stderr(&format!(
66-
"\
64+
foo.cargo("build --verbose").with_stderr("\
6765
[COMPILING] foo v0.5.0 ([CWD])
68-
[RUNNING] `rustc [..] -C ar={root}bogus/nonexistent-ar -C linker={root}bogus/nonexistent-linker [..]`
66+
[RUNNING] `rustc [..] -C ar=[ROOT]bogus/nonexistent-ar -C linker=[ROOT]bogus/nonexistent-linker [..]`
6967
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
70-
",
71-
root = root,
72-
)).run();
68+
").run();
7369
}
7470

7571
#[test]

0 commit comments

Comments
 (0)