Add test for doc comments unindent fix
This commit is contained in:
parent
06fe278669
commit
b4c35368f4
2 changed files with 51 additions and 32 deletions
23
src/test/rustdoc/unindent.rs
Normal file
23
src/test/rustdoc/unindent.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/struct.Example.html
|
||||
// @matches - '//pre[@class="rust rust-example-rendered"]' \
|
||||
// '(?m)let example = Example::new\(\)\n \.first\(\)\n \.second\(\)\n \.build\(\);\Z'
|
||||
/// ```rust
|
||||
/// let example = Example::new()
|
||||
/// .first()
|
||||
#[cfg_attr(not(feature = "one"), doc = " .second()")]
|
||||
/// .build();
|
||||
/// ```
|
||||
pub struct Example;
|
||||
|
||||
// @has foo/struct.F.html
|
||||
// @matches - '//pre[@class="rust rust-example-rendered"]' \
|
||||
// '(?m)let example = Example::new\(\)\n \.first\(\)\n \.another\(\)\n \.build\(\);\Z'
|
||||
///```rust
|
||||
///let example = Example::new()
|
||||
/// .first()
|
||||
#[cfg_attr(not(feature = "one"), doc = " .another()")]
|
||||
/// .build();
|
||||
/// ```
|
||||
pub struct F;
|
||||
Loading…
Add table
Add a link
Reference in a new issue