File tree Expand file tree Collapse file tree 3 files changed +27
-14
lines changed Expand file tree Collapse file tree 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() {
4545#[ test]
4646fn test_doc_blocks ( ) {
4747 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 ) ;
5650 assert_eq ! ( stripped. as_str( ) , " # Returns\n \n " ) ;
5751
5852 let stripped = beautify_doc_string (
59- Symbol :: intern (
60- "
61- * # Returns
62- *
63- " ,
64- ) ,
53+ Symbol :: intern ( "\n * # Returns\n *\n " ) ,
6554 CommentKind :: Block ,
6655 ) ;
6756 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 " ) ;
6860 } )
6961}
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