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