Skip to content

Commit

Permalink
test path and args
Browse files Browse the repository at this point in the history
  • Loading branch information
lf- committed May 15, 2021
1 parent 6ea1eb3 commit ed46a9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/cargo/ops/cargo_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ pub fn doc(ws: &Workspace<'_>, options: &DocOptions) -> CargoResult<()> {
open_docs(
&path,
&mut shell,
cfg.browser.map(|path_args| {
(path_args.path.resolve_program(&ws.config()), path_args.args)
}),
cfg.browser
.map(|path_args| (path_args.path.resolve_program(ws.config()), path_args.args)),
)?;
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1189,15 +1189,15 @@ fn doc_workspace_open_different_library_and_package_names() {
p.change_file(
".cargo/config.toml",
r#"
[cargo-doc]
browser = "echo"
[doc]
browser = ["echo", "a"]
"#,
);

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

Expand Down

0 comments on commit ed46a9a

Please sign in to comment.