diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-02-06 22:21:09 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-02-07 17:07:53 +0100 |
| commit | 33cbf8908d4cf1c971128ee35e7bd2ea50225b63 (patch) | |
| tree | 1421dc8530d9c8ed98a7ca11b36bfcc2e8e0866b /compiler/rustc_ast/src | |
| parent | e3942874a06677f17be284f27b5494531cc7224a (diff) | |
| download | rust-33cbf8908d4cf1c971128ee35e7bd2ea50225b63.tar.gz rust-33cbf8908d4cf1c971128ee35e7bd2ea50225b63.zip | |
Add test for block doc comments horizontal trim
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/util/comments/tests.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/compiler/rustc_ast/src/util/comments/tests.rs b/compiler/rustc_ast/src/util/comments/tests.rs index 0b8772947e6..11d50603a10 100644 --- a/compiler/rustc_ast/src/util/comments/tests.rs +++ b/compiler/rustc_ast/src/util/comments/tests.rs @@ -45,25 +45,17 @@ fn test_line_doc_comment() { #[test] fn test_doc_blocks() { create_default_session_globals_then(|| { - let stripped = beautify_doc_string( - Symbol::intern( - " # Returns - * - ", - ), - CommentKind::Block, - ); + let stripped = + beautify_doc_string(Symbol::intern(" # Returns\n *\n "), CommentKind::Block); assert_eq!(stripped.as_str(), " # Returns\n\n"); let stripped = beautify_doc_string( - Symbol::intern( - " - * # Returns - * - ", - ), + Symbol::intern("\n * # Returns\n *\n "), CommentKind::Block, ); assert_eq!(stripped.as_str(), " # Returns\n\n"); + + let stripped = beautify_doc_string(Symbol::intern("\n * a\n "), CommentKind::Block); + assert_eq!(stripped.as_str(), " a\n"); }) } |
