MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / test_complexity_for_loop

Function test_complexity_for_loop

tests/graph_suite/complexity_test.rs:105–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104#[test]
105fn test_complexity_for_loop() {
106 let m = rust_fn_complexity(
107 r#"
108fn 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]
121fn test_complexity_while_loop() {

Callers

nothing calls this directly

Calls 1

rust_fn_complexityFunction · 0.85

Tested by

no test coverage detected