()
| 60 | |
| 61 | #[test] |
| 62 | fn test_complexity_if_else() { |
| 63 | let m = rust_fn_complexity( |
| 64 | r#" |
| 65 | fn check(x: i32) { |
| 66 | if x > 0 { |
| 67 | println!("positive"); |
| 68 | } else { |
| 69 | println!("non-positive"); |
| 70 | } |
| 71 | } |
| 72 | "#, |
| 73 | ); |
| 74 | // if + else_clause |
| 75 | assert!( |
| 76 | m.branches >= 2, |
| 77 | "if/else = at least 2 branches, got {}", |
| 78 | m.branches |
| 79 | ); |
| 80 | } |
| 81 | |
| 82 | #[test] |
| 83 | fn test_complexity_match_arms() { |
nothing calls this directly
no test coverage detected