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

Function test_merge_appends_to_existing_heading

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

Source from the content-addressed store, hash-verified

912
913 #[test]
914 fn test_merge_appends_to_existing_heading() {
915 let existing = format!(
916 "# Project\n\n{}\n\n### Repo\n- Existing\n\n{}\n\nOther content.\n",
917 SECTION_START, SECTION_END
918 );
919 let mut new_items = HashMap::new();
920 new_items.insert("### Repo".to_string(), vec!["- New repo item".to_string()]);
921 let result = merge_items_into_section(&existing, &new_items);
922
923 assert!(result.contains("- Existing"));
924 assert!(result.contains("- New repo item"));
925 assert!(result.contains("Other content."));
926 // Should have only ONE ### Repo heading
927 assert_eq!(result.matches("### Repo").count(), 1);
928 }
929
930 #[test]
931 fn test_merge_adds_new_heading() {

Callers

nothing calls this directly

Calls 2

merge_items_into_sectionFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected