Skip to content

Commit ed46a9a

Browse files
committed
test path and args
1 parent 6ea1eb3 commit ed46a9a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/cargo/ops/cargo_doc.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ pub fn doc(ws: &Workspace<'_>, options: &DocOptions) -> CargoResult<()> {
9595
open_docs(
9696
&path,
9797
&mut shell,
98-
cfg.browser.map(|path_args| {
99-
(path_args.path.resolve_program(&ws.config()), path_args.args)
100-
}),
98+
cfg.browser
99+
.map(|path_args| (path_args.path.resolve_program(ws.config()), path_args.args)),
101100
)?;
102101
}
103102
}

tests/testsuite/doc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,15 +1189,15 @@ fn doc_workspace_open_different_library_and_package_names() {
11891189
p.change_file(
11901190
".cargo/config.toml",
11911191
r#"
1192-
[cargo-doc]
1193-
browser = "echo"
1192+
[doc]
1193+
browser = ["echo", "a"]
11941194
"#,
11951195
);
11961196

11971197
// check that the cargo config overrides the browser env var
11981198
p.cargo("doc --open")
11991199
.env("BROWSER", "true")
1200-
.with_stderr_contains("[..] [CWD]/target/doc/foolib/index.html")
1200+
.with_stdout_contains("[..]a [CWD]/target/doc/foolib/index.html")
12011201
.run();
12021202
}
12031203

0 commit comments

Comments
 (0)