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:933–952  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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