Skip to content

Commit

Permalink
issue(5801): adding tests for comment wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
IVIURRAY committed Dec 29, 2023
1 parent 85e21fa commit 2fa6ba1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/source/configs/comment_width/5801.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// rustfmt-comment_width: 120
// rustfmt-wrap_comments: true
// rustfmt-unstable_features: true
// rustfmt-max_width: 120

/// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine
fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String {
unimplemented!()
}

pub enum Severity {
/// But here, this comment is 120 columns wide and the formatter wants to split it up onto two separate lines still.
Error,
/// This comment is 119 columns wide and works perfectly. Lorem ipsum. lorem ipsum. lorem ipsum. lorem ipsum lorem.
Warning,
}
16 changes: 16 additions & 0 deletions tests/target/configs/comment_width/5801.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// rustfmt-comment_width: 120
// rustfmt-wrap_comments: true
// rustfmt-unstable_features: true
// rustfmt-max_width: 120

/// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine
fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String {
unimplemented!()
}

pub enum Severity {
/// But here, this comment is 120 columns wide and the formatter wants to split it up onto two separate lines still.
Error,
/// This comment is 119 columns wide and works perfectly. Lorem ipsum. lorem ipsum. lorem ipsum. lorem ipsum lorem.
Warning,
}

0 comments on commit 2fa6ba1

Please sign in to comment.