File tree 3 files changed +43
-6
lines changed
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() {
37
37
38
38
#[ test]
39
39
fn 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" ) ;
46
41
}
47
42
48
43
#[ 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
+
1
3
#![ crate_name = "foo" ]
2
4
3
5
// @has foo/struct.Example.html
@@ -21,3 +23,42 @@ pub struct Example;
21
23
/// .build();
22
24
/// ```
23
25
pub 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