diff options
Diffstat (limited to 'src/tools/rustfmt/tests/target/issue-5238')
-rw-r--r-- | src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_false.rs | 11 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_true.rs | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_false.rs b/src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_false.rs new file mode 100644 index 000000000..229c6e575 --- /dev/null +++ b/src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_false.rs @@ -0,0 +1,11 @@ +// rustfmt-wrap_comments: false + +/// no markdown header so rustfmt should wrap this comment when `format_code_in_doc_comments = true` and `wrap_comments = true` +fn not_documented_with_markdown_header() { + // This is just a normal inline comment so rustfmt should wrap this comment when `wrap_comments = true` +} + +/// # We're using a markdown header here so rustfmt should refuse to wrap this comment in all circumstances +fn documented_with_markdown_header() { + // # We're using a markdown header in an inline comment. rustfmt should be able to wrap this comment when `wrap_comments = true` +} diff --git a/src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_true.rs b/src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_true.rs new file mode 100644 index 000000000..87dae58ec --- /dev/null +++ b/src/tools/rustfmt/tests/target/issue-5238/markdown_header_wrap_comments_true.rs @@ -0,0 +1,14 @@ +// rustfmt-wrap_comments: true + +/// no markdown header so rustfmt should wrap this comment when +/// `format_code_in_doc_comments = true` and `wrap_comments = true` +fn not_documented_with_markdown_header() { + // This is just a normal inline comment so rustfmt should wrap this comment + // when `wrap_comments = true` +} + +/// # We're using a markdown header here so rustfmt should refuse to wrap this comment in all circumstances +fn documented_with_markdown_header() { + // # We're using a markdown header in an inline comment. rustfmt should be + // able to wrap this comment when `wrap_comments = true` +} |