Update tests

This commit is contained in:
Guillaume Gomez 2020-10-29 11:43:07 +01:00
parent 6bbb7fd265
commit fcee70f643
3 changed files with 43 additions and 6 deletions

View File

@ -37,12 +37,7 @@ fn should_leave_multiple_indent_levels() {
#[test]
fn should_ignore_first_line_indent() {
// The first line of the first paragraph may not be indented as
// far due to the way the doc string was written:
//
// #[doc = "Start way over here
// and continue here"]
run_test("line1\n line2", "line1\nline2");
run_test("line1\n line2", "line1\n line2");
}
#[test]

View File

@ -0,0 +1 @@
Just some text.

View File

@ -1,3 +1,5 @@
#![feature(external_doc)]
#![crate_name = "foo"]
// @has foo/struct.Example.html
@ -21,3 +23,42 @@ pub struct Example;
/// .build();
/// ```
pub struct F;
// @has foo/struct.G.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 G;
// @has foo/struct.H.html
// @has - '//div[@class="docblock"]/p' 'no whitespace lol'
///no whitespace
#[doc = " lol"]
pub struct H;
// @has foo/struct.I.html
// @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z'
/// 4 whitespaces!
#[doc = "something"]
pub struct I;
// @has foo/struct.J.html
// @matches - '//div[@class="docblock"]/p' '(?m)a\nno whitespace\nJust some text.\Z'
///a
///no whitespace
#[doc(include = "unindent.md")]
pub struct J;
// @has foo/struct.K.html
// @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z'
///a
///
/// 4 whitespaces!
///
#[doc(include = "unindent.md")]
pub struct K;