File tree 3 files changed +27
-14
lines changed
3 files changed +27
-14
lines changed Original file line number Diff line number Diff line change @@ -45,25 +45,17 @@ fn test_line_doc_comment() {
45
45
#[ test]
46
46
fn test_doc_blocks ( ) {
47
47
create_default_session_globals_then ( || {
48
- let stripped = beautify_doc_string (
49
- Symbol :: intern (
50
- " # Returns
51
- *
52
- " ,
53
- ) ,
54
- CommentKind :: Block ,
55
- ) ;
48
+ let stripped =
49
+ beautify_doc_string ( Symbol :: intern ( " # Returns\n *\n " ) , CommentKind :: Block ) ;
56
50
assert_eq ! ( stripped. as_str( ) , " # Returns\n \n " ) ;
57
51
58
52
let stripped = beautify_doc_string (
59
- Symbol :: intern (
60
- "
61
- * # Returns
62
- *
63
- " ,
64
- ) ,
53
+ Symbol :: intern ( "\n * # Returns\n *\n " ) ,
65
54
CommentKind :: Block ,
66
55
) ;
67
56
assert_eq ! ( stripped. as_str( ) , " # Returns\n \n " ) ;
57
+
58
+ let stripped = beautify_doc_string ( Symbol :: intern ( "\n * a\n " ) , CommentKind :: Block ) ;
59
+ assert_eq ! ( stripped. as_str( ) , " a\n " ) ;
68
60
} )
69
61
}
Original file line number Diff line number Diff line change
1
+ // check-pass
2
+ // compile-flags:--test
3
+
4
+ // This test ensures that no code block is detected in the doc comments.
5
+
6
+ pub mod Wormhole {
7
+ /** # Returns
8
+ *
9
+ */
10
+ pub fn foofoo ( ) { }
11
+ /**
12
+ * # Returns
13
+ *
14
+ */
15
+ pub fn barbar ( ) { }
16
+ }
Original file line number Diff line number Diff line change
1
+
2
+ running 0 tests
3
+
4
+ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
5
+
You can’t perform that action at this time.
0 commit comments