MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_commit_and_verify

Function test_commit_and_verify

atomic-agent/src/provenance/consolidate.rs:931–956  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

929
930 #[test]
931 fn test_commit_and_verify() {
932 let mut nodes = vec![
933 goal("g1", "Fix"),
934 commitment("c1", "src/auth.rs"),
935 verification("v1", "cargo test", true),
936 ];
937 let mut edges = Vec::new();
938 let mut stats = GraphStats::default();
939 stats.goal_count = 1;
940 stats.commitment_count = 1;
941 stats.verification_count = 1;
942
943 let created = run_consolidate(&mut nodes, &mut edges, &mut stats);
944
945 assert_eq!(created, 1);
946
947 let decision = nodes.iter().find(|n| n.kind == NodeKind::Decision).unwrap();
948 assert!(decision.summary.contains("auth.rs"));
949 assert!(decision.summary.contains("cargo test"));
950
951 let detail = decision.detail.as_ref().unwrap();
952 assert_eq!(
953 detail.get("pattern").unwrap().as_str().unwrap(),
954 "commit_and_verify"
955 );
956 }
957
958 // ---- Full cycle ----
959

Callers

nothing calls this directly

Calls 4

run_consolidateFunction · 0.85
as_refMethod · 0.80
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected