()
| 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() { |
nothing calls this directly
no test coverage detected