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

Function test_complexity_if_else

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

Source from the content-addressed store, hash-verified

60
61#[test]
62fn test_complexity_if_else() {
63 let m = rust_fn_complexity(
64 r#"
65fn 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]
83fn test_complexity_match_arms() {

Callers

nothing calls this directly

Calls 1

rust_fn_complexityFunction · 0.85

Tested by

no test coverage detected