()
| 103 | |
| 104 | #[test] |
| 105 | fn test_complexity_for_loop() { |
| 106 | let m = rust_fn_complexity( |
| 107 | r#" |
| 108 | fn sum(items: &[i32]) -> i32 { |
| 109 | let mut s = 0; |
| 110 | for &x in items { |
| 111 | s += x; |
| 112 | } |
| 113 | s |
| 114 | } |
| 115 | "#, |
| 116 | ); |
| 117 | assert_eq!(m.loops, 1); |
| 118 | } |
| 119 | |
| 120 | #[test] |
| 121 | fn test_complexity_while_loop() { |
nothing calls this directly
no test coverage detected