Skip to content

Commit 8b3b1c9

Browse files
committed
Add rustdoc UI tests for new description behaviour
1 parent bcef5e7 commit 8b3b1c9

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/test/rustdoc/description.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![crate_name = "foo"]
2+
//! # Description test crate
3+
//!
4+
//! This is the contents of the test crate docstring. It should not show up in the description.
5+
6+
// @matches 'foo/index.html' '//meta[@name="description"]/@content' 'Description test crate'
7+
8+
// @matches 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' 'First paragraph description.'
9+
/// First paragraph description.
10+
///
11+
/// Second paragraph should not show up.
12+
pub mod foo_mod {
13+
pub struct __Thing {}
14+
}
15+
16+
// @matches 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' 'Only paragraph.'
17+
/// Only paragraph.
18+
pub fn foo_fn() {}
19+
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![crate_name = "foo"]
2+
3+
// @matches 'foo/index.html' '//meta[@name="description"]/@content' 'API documentation for the Rust `foo` crate.'
4+
5+
// @matches 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' 'API documentation for the Rust `foo_mod` mod in crate `foo`.'
6+
pub mod foo_mod {
7+
pub struct __Thing {}
8+
}
9+
10+
// @matches 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' 'API documentation for the Rust `foo_fn` fn in crate `foo`.'
11+
pub fn foo_fn() {}
12+

0 commit comments

Comments
 (0)