Skip to content

Commit b6c2b30

Browse files
Add regression test for inclusion of whitespace characters in rustdoc highlighting
1 parent 5df9593 commit b6c2b30

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// We need this option to be enabled for the `foo` macro declaration to ensure
2+
// that the link on the ident is not including whitespace characters.
3+
4+
//@ compile-flags: -Zunstable-options --generate-link-to-definition
5+
#![crate_name = "foo"]
6+
#![rustfmt::skip]
7+
8+
// @has 'src/foo/source-code-highlight.rs.html'
9+
10+
// @hasraw - '<a href="../../foo/macro.foo.html">foo</a>'
11+
#[macro_export]
12+
macro_rules! foo {
13+
() => {}
14+
}
15+
16+
// @hasraw - '<span class="macro">foo!</span>'
17+
foo! {}
18+
19+
// @hasraw - '<a href="../../foo/fn.f.html">f</a>'
20+
pub fn f () {}
21+
// @hasraw - '<a href="../../foo/struct.Bar.html">Bar</a>'
22+
// @hasraw - '<a href="../../foo/struct.Bar.html">Bar</a>'
23+
// @hasraw - '<a href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>'
24+
pub struct Bar ( u32 );
25+
// @hasraw - '<a href="../../foo/enum.Foo.html">Foo</a>'
26+
pub enum Foo {
27+
A,
28+
}

0 commit comments

Comments
 (0)