File tree Expand file tree Collapse file tree 3 files changed +43
-6
lines changed Expand file tree Collapse file tree 3 files changed +43
-6
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,7 @@ fn should_leave_multiple_indent_levels() {
3737
3838#[ test]
3939fn should_ignore_first_line_indent ( ) {
40- // The first line of the first paragraph may not be indented as
41- // far due to the way the doc string was written:
42- //
43- // #[doc = "Start way over here
44- // and continue here"]
45- run_test ( "line1\n line2" , "line1\n line2" ) ;
40+ run_test ( "line1\n line2" , "line1\n line2" ) ;
4641}
4742
4843#[ test]
Original file line number Diff line number Diff line change 1+ Just some text.
Original file line number Diff line number Diff line change 1+ #![ feature( external_doc) ]
2+
13#![ crate_name = "foo" ]
24
35// @has foo/struct.Example.html
@@ -21,3 +23,42 @@ pub struct Example;
2123/// .build();
2224/// ```
2325pub struct F ;
26+
27+ // @has foo/struct.G.html
28+ // @matches - '//pre[@class="rust rust-example-rendered"]' \
29+ // '(?m)let example = Example::new\(\)\n\.first\(\)\n \.another\(\)\n\.build\(\);\Z'
30+ ///```rust
31+ ///let example = Example::new()
32+ ///.first()
33+ #[ cfg_attr( not( feature = "one" ) , doc = " .another()" ) ]
34+ ///.build();
35+ ///```
36+ pub struct G ;
37+
38+ // @has foo/struct.H.html
39+ // @has - '//div[@class="docblock"]/p' 'no whitespace lol'
40+ ///no whitespace
41+ #[ doc = " lol" ]
42+ pub struct H ;
43+
44+ // @has foo/struct.I.html
45+ // @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z'
46+ /// 4 whitespaces!
47+ #[ doc = "something" ]
48+ pub struct I ;
49+
50+ // @has foo/struct.J.html
51+ // @matches - '//div[@class="docblock"]/p' '(?m)a\nno whitespace\nJust some text.\Z'
52+ ///a
53+ ///no whitespace
54+ #[ doc( include = "unindent.md" ) ]
55+ pub struct J ;
56+
57+ // @has foo/struct.K.html
58+ // @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z'
59+ ///a
60+ ///
61+ /// 4 whitespaces!
62+ ///
63+ #[ doc( include = "unindent.md" ) ]
64+ pub struct K ;
You can’t perform that action at this time.
0 commit comments