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

Function test_merge_adds_new_heading

atomic-agent/src/learnings.rs:931–950  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

929
930 #[test]
931 fn test_merge_adds_new_heading() {
932 let existing = format!(
933 "{}\n\n### Repo\n- Existing repo\n\n{}\n",
934 SECTION_START, SECTION_END
935 );
936 let mut new_items = HashMap::new();
937 new_items.insert(
938 "### Workflow".to_string(),
939 vec!["- New workflow tip".to_string()],
940 );
941 let result = merge_items_into_section(&existing, &new_items);
942
943 assert!(result.contains("### Repo"));
944 assert!(result.contains("### Workflow"));
945 assert!(result.contains("- Existing repo"));
946 assert!(result.contains("- New workflow tip"));
947 // Each heading appears only once
948 assert_eq!(result.matches("### Repo").count(), 1);
949 assert_eq!(result.matches("### Workflow").count(), 1);
950 }
951
952 #[test]
953 fn test_merge_no_markers() {

Callers

nothing calls this directly

Calls 2

merge_items_into_sectionFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected