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

Source from the content-addressed store, hash-verified

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