()
| 959 | |
| 960 | #[test] |
| 961 | fn test_full_cycle() { |
| 962 | let mut nodes = vec![ |
| 963 | goal("g1", "Fix the auth bug"), |
| 964 | exploration("e1", "src/auth/login.rs"), |
| 965 | exploration("e2", "src/auth/jwt.rs"), |
| 966 | commitment("c1", "src/auth/login.rs"), |
| 967 | verification("v1", "cargo test --lib", true), |
| 968 | ]; |
| 969 | let mut edges = Vec::new(); |
| 970 | let mut stats = GraphStats::default(); |
| 971 | stats.goal_count = 1; |
| 972 | stats.exploration_count = 2; |
| 973 | stats.commitment_count = 1; |
| 974 | stats.verification_count = 1; |
| 975 | |
| 976 | let created = run_consolidate(&mut nodes, &mut edges, &mut stats); |
| 977 | |
| 978 | assert_eq!(created, 1); |
| 979 | |
| 980 | let decision = nodes.iter().find(|n| n.kind == NodeKind::Decision).unwrap(); |
| 981 | assert!(decision.summary.contains("2 files")); |
| 982 | assert!(decision.summary.contains("login.rs")); |
| 983 | assert!(decision.summary.contains("cargo test")); |
| 984 | |
| 985 | let detail = decision.detail.as_ref().unwrap(); |
| 986 | assert_eq!( |
| 987 | detail.get("pattern").unwrap().as_str().unwrap(), |
| 988 | "full_cycle" |
| 989 | ); |
| 990 | } |
| 991 | |
| 992 | // ---- Backtracking ---- |
| 993 |
nothing calls this directly
no test coverage detected