Skip to content

Commit 4308c37

Browse files
author
Niko Matsakis
committed
additional test
1 parent 2443714 commit 4308c37

File tree

1 file changed

+12
-0
lines changed
  • crates/rust-project-goals-cli/src

1 file changed

+12
-0
lines changed

crates/rust-project-goals-cli/src/cfp.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,18 @@ mod tests {
487487
assert!(result.contains("running from January 1 to June 30"));
488488
assert!(!result.contains("Old content."));
489489
}
490+
491+
#[test]
492+
fn test_process_readme_content_with_existing_section_and_extra() {
493+
// Test updating an existing section while preserving unrelated sections
494+
let content = "# Project goals\n\n## Current goal period (2025H1)\n\nThe 2025H1 goal period runs from Jan 1 to Jun 30.\n\n## Next goal period (2026H1)\n\nOld content.\n\n## Extra section\nsome content";
495+
let result = process_readme_content(content, "2026h1", "2026h1");
496+
497+
assert!(result.contains("## Next goal period (2026H1)"));
498+
assert!(result.contains("running from January 1 to June 30"));
499+
assert!(!result.contains("Old content."));
500+
assert!(result.contains("## Extra section\nsome content"));
501+
}
490502

491503
#[test]
492504
fn test_process_readme_content_with_different_timeframe() {

0 commit comments

Comments
 (0)