Skip to content

Commit 3cd5f9d

Browse files
authored
Merge pull request #5401 from cakebaker/clippy_suppress_cognitive_complexity_warning
clippy: suppress cognitive_complexity lint in some tests
2 parents 617de9b + a69d48f commit 3cd5f9d

File tree

15 files changed

+21
-0
lines changed

15 files changed

+21
-0
lines changed

src/uu/csplit/src/csplit.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ mod tests {
664664
use super::*;
665665

666666
#[test]
667+
#[allow(clippy::cognitive_complexity)]
667668
fn input_splitter() {
668669
let input = vec![
669670
Ok(String::from("aaa")),
@@ -736,6 +737,7 @@ mod tests {
736737
}
737738

738739
#[test]
740+
#[allow(clippy::cognitive_complexity)]
739741
fn input_splitter_interrupt_rewind() {
740742
let input = vec![
741743
Ok(String::from("aaa")),

src/uu/csplit/src/patterns.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ mod tests {
211211
}
212212

213213
#[test]
214+
#[allow(clippy::cognitive_complexity)]
214215
fn up_to_match_pattern() {
215216
let input: Vec<String> = vec![
216217
"/test1.*end$/",
@@ -264,6 +265,7 @@ mod tests {
264265
}
265266

266267
#[test]
268+
#[allow(clippy::cognitive_complexity)]
267269
fn skip_to_match_pattern() {
268270
let input: Vec<String> = vec![
269271
"%test1.*end$%",

src/uu/dd/src/numbers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ mod tests {
115115
}
116116

117117
#[test]
118+
#[allow(clippy::cognitive_complexity)]
118119
fn test_to_magnitude_and_suffix_not_powers_of_1024() {
119120
assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si), "1.0 B");
120121
assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si), "999 B");

src/uu/dd/src/parseargs/unit_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ fn test_status_level_none() {
103103
}
104104

105105
#[test]
106+
#[allow(clippy::cognitive_complexity)]
106107
fn test_all_top_level_args_no_leading_dashes() {
107108
let args = &[
108109
"if=foo.file",

src/uu/df/src/blocks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ mod tests {
239239
}
240240

241241
#[test]
242+
#[allow(clippy::cognitive_complexity)]
242243
fn test_to_magnitude_and_suffix_not_powers_of_1024() {
243244
assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si), "1B");
244245
assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si), "999B");

src/uu/head/src/head.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ mod tests {
548548
}
549549

550550
#[test]
551+
#[allow(clippy::cognitive_complexity)]
551552
fn all_args_test() {
552553
assert!(options("--silent").unwrap().quiet);
553554
assert!(options("--quiet").unwrap().quiet);

src/uu/head/src/parse.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ mod tests {
153153
}
154154

155155
#[test]
156+
#[allow(clippy::cognitive_complexity)]
156157
fn test_parse_numbers_obsolete() {
157158
assert_eq!(obsolete("-5"), obsolete_result(&["-n", "5"]));
158159
assert_eq!(obsolete("-100"), obsolete_result(&["-n", "100"]));

src/uu/nl/src/nl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ mod test {
394394
use super::*;
395395

396396
#[test]
397+
#[allow(clippy::cognitive_complexity)]
397398
fn test_format() {
398399
assert_eq!(NumberFormat::Left.format(12, 1), "12");
399400
assert_eq!(NumberFormat::Left.format(-12, 1), "-12");

src/uu/numfmt/src/format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ mod tests {
430430
use super::*;
431431

432432
#[test]
433+
#[allow(clippy::cognitive_complexity)]
433434
fn test_round_with_precision() {
434435
let rm = RoundMethod::FromZero;
435436
assert_eq!(1.0, round_with_precision(0.12345, rm, 0));

src/uu/numfmt/src/options.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ mod tests {
266266
}
267267

268268
#[test]
269+
#[allow(clippy::cognitive_complexity)]
269270
fn test_parse_format_with_invalid_formats() {
270271
assert!("".parse::<FormatOptions>().is_err());
271272
assert!("hello".parse::<FormatOptions>().is_err());

0 commit comments

Comments
 (0)