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