-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2590 from phansch/fix_another_false_positive
Fix false positive in empty_line_after_outer_attr
- Loading branch information
Showing
4 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
extern crate clippy_lints; | ||
use clippy_lints::utils::without_block_comments; | ||
|
||
#[test] | ||
fn test_lines_without_block_comments() { | ||
let result = without_block_comments(vec!["/*", "", "*/"]); | ||
println!("result: {:?}", result); | ||
assert!(result.is_empty()); | ||
|
||
let result = without_block_comments( | ||
vec!["", "/*", "", "*/", "#[crate_type = \"lib\"]", "/*", "", "*/", ""] | ||
); | ||
assert_eq!(result, vec!["", "#[crate_type = \"lib\"]", ""]); | ||
|
||
let result = without_block_comments(vec!["/* rust", "", "*/"]); | ||
assert!(result.is_empty()); | ||
|
||
let result = without_block_comments(vec!["/* one-line comment */"]); | ||
assert!(result.is_empty()); | ||
|
||
let result = without_block_comments(vec!["/* nested", "/* multi-line", "comment", "*/", "test", "*/"]); | ||
assert!(result.is_empty()); | ||
|
||
let result = without_block_comments(vec!["/* nested /* inline /* comment */ test */ */"]); | ||
assert!(result.is_empty()); | ||
|
||
let result = without_block_comments(vec!["foo", "bar", "baz"]); | ||
assert_eq!(result, vec!["foo", "bar", "baz"]); | ||
} |