mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
29 lines
1 KiB
Rust
29 lines
1 KiB
Rust
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"]);
|
|
}
|