Skip to content

Commit 07843ed

Browse files
committedDec 16, 2021
add open_no_doc_crate test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent 94d0767 commit 07843ed

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
 

‎tests/testsuite/doc.rs

+25
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,31 @@ fn doc_extern_map_local() {
13441344
.run();
13451345
}
13461346

1347+
#[cargo_test]
1348+
fn open_no_doc_crate() {
1349+
let p = project()
1350+
.file(
1351+
"Cargo.toml",
1352+
r#"
1353+
[package]
1354+
name = "a"
1355+
version = "0.0.1"
1356+
authors = []
1357+
1358+
[lib]
1359+
doc = false
1360+
"#,
1361+
)
1362+
.file("src/lib.rs", "#[cfg(feature)] pub fn f();")
1363+
.build();
1364+
1365+
p.cargo("doc --open")
1366+
.env("BROWSER", "do_not_run_me")
1367+
.with_status(101)
1368+
.with_stderr_contains("error: no crates with documentation")
1369+
.run();
1370+
}
1371+
13471372
#[cargo_test]
13481373
fn doc_workspace_open_different_library_and_package_names() {
13491374
let p = project()

0 commit comments

Comments
 (0)
Please sign in to comment.