Skip to content

Commit d715015

Browse files
committed
Improve tests
Now this actually tests the links are generated correctly
1 parent e885f00 commit d715015

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#![crate_name = "inner"]
2+
3+
/// Documentation, including a link to [std::ptr]
4+
pub fn f() {}
+14-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1+
// aux-build: intra-link-pub-use.rs
12
#![deny(broken_intra_doc_links)]
3+
#![crate_name = "outer"]
4+
5+
extern crate inner;
6+
7+
/// [mod@std::env] [g]
28
3-
/// [std::env] [g]
49
// FIXME: This can't be tested because rustdoc doesn't show documentation on pub re-exports.
510
// Until then, comment out the `htmldocck` test.
611
// This test still does something; namely check that no incorrect errors are emitted when
712
// documenting the re-export.
813

9-
// @has intra_link_pub_use/index.html
14+
// @has outer/index.html
1015
// @ has - '//a[@href="https://doc.rust-lang.org/nightly/std/env/fn.var.html"]' "std::env"
11-
// @ has - '//a[@href="../intra_link_pub_use/fn.f.html"]' "g"
16+
// @ has - '//a[@href="../outer/fn.f.html"]' "g"
1217
pub use f as g;
1318

19+
// FIXME: same as above
1420
/// [std::env]
1521
extern crate self as _;
1622

17-
pub fn f() {}
23+
// Make sure the documentation is actually correct by documenting an inlined re-export
24+
/// [mod@std::env]
25+
// @has outer/fn.f.html
26+
// @has - '//a[@href="https://doc.rust-lang.org/nightly/std/env/index.html"]' "std::env"
27+
pub use inner::f;

0 commit comments

Comments
 (0)