From: Esteve Fernandez Date: Tue, 29 May 2018 09:55:29 +0000 (+0200) Subject: Added test where the name of the library is different from the package's. X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2^2~12^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3d63b12f7c73e3249496d2db1d5113a9c9c2fb7a;p=cargo.git Added test where the name of the library is different from the package's. --- diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index cba714de6..a7483212c 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -1480,6 +1480,39 @@ fn doc_workspace_open_help_message() { ); } +#[test] +fn doc_workspace_open_different_library_and_package_names() { + let p = project("foo") + .file( + "Cargo.toml", + r#" + [workspace] + members = ["foo"] + "#, + ) + .file( + "foo/Cargo.toml", + r#" + [package] + name = "foo" + version = "0.1.0" + [lib] + name = "foolib" + "#, + ) + .file("foo/src/lib.rs", "") + .build(); + + // The order in which bar is compiled or documented is not deterministic + assert_that( + p.cargo("doc").arg("--open").env("BROWSER", "echo"), + execs() + .with_status(0) + .with_stderr_contains("[..] Documenting foo v0.1.0 ([..])") + .with_stderr_contains("[..] Opening [..]/foo/target/doc/foolib/index.html") + ); +} + #[test] fn doc_edition() { if !cargotest::is_nightly() {