huskies: merge 864
This commit is contained in:
@@ -46,8 +46,18 @@ fn next_item_number_increments_from_existing_bugs() {
|
||||
fs::write(backlog.join("1_bug_crash.md"), "").unwrap();
|
||||
fs::write(backlog.join("3_bug_another.md"), "").unwrap();
|
||||
// Also write to content store so next_item_number sees them.
|
||||
crate::db::write_item_with_content("1_bug_crash", "1_backlog", "---\nname: Crash\n---\n");
|
||||
crate::db::write_item_with_content("3_bug_another", "1_backlog", "---\nname: Another\n---\n");
|
||||
crate::db::write_item_with_content(
|
||||
"1_bug_crash",
|
||||
"1_backlog",
|
||||
"---\nname: Crash\n---\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Crash\n---\n"),
|
||||
);
|
||||
crate::db::write_item_with_content(
|
||||
"3_bug_another",
|
||||
"1_backlog",
|
||||
"---\nname: Another\n---\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Another\n---\n"),
|
||||
);
|
||||
assert!(super::super::next_item_number(tmp.path()).unwrap() >= 4);
|
||||
}
|
||||
|
||||
@@ -61,7 +71,12 @@ fn next_item_number_scans_archived_too() {
|
||||
fs::create_dir_all(&archived).unwrap();
|
||||
fs::write(archived.join("5_bug_old.md"), "").unwrap();
|
||||
// Also write to content store so next_item_number sees it.
|
||||
crate::db::write_item_with_content("5_bug_old", "5_done", "---\nname: Old Bug\n---\n");
|
||||
crate::db::write_item_with_content(
|
||||
"5_bug_old",
|
||||
"5_done",
|
||||
"---\nname: Old Bug\n---\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Old Bug\n---\n"),
|
||||
);
|
||||
assert!(super::super::next_item_number(tmp.path()).unwrap() >= 6);
|
||||
}
|
||||
|
||||
@@ -83,12 +98,14 @@ fn list_bug_files_excludes_archive_subdir() {
|
||||
"7001_bug_open",
|
||||
"1_backlog",
|
||||
"---\nname: Open Bug\n---\n# Bug 7001: Open Bug\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Open Bug\n---\n# Bug 7001: Open Bug\n"),
|
||||
);
|
||||
// Bug in done (should NOT appear — list_bug_files only returns Backlog).
|
||||
crate::db::write_item_with_content(
|
||||
"7002_bug_closed",
|
||||
"5_done",
|
||||
"---\nname: Closed Bug\n---\n# Bug 7002: Closed Bug\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Closed Bug\n---\n# Bug 7002: Closed Bug\n"),
|
||||
);
|
||||
|
||||
let result = list_bug_files(tmp.path()).unwrap();
|
||||
@@ -108,16 +125,19 @@ fn list_bug_files_sorted_by_id() {
|
||||
"7013_bug_third",
|
||||
"1_backlog",
|
||||
"---\nname: Third\n---\n# Bug 7013: Third\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Third\n---\n# Bug 7013: Third\n"),
|
||||
);
|
||||
crate::db::write_item_with_content(
|
||||
"7011_bug_first",
|
||||
"1_backlog",
|
||||
"---\nname: First\n---\n# Bug 7011: First\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: First\n---\n# Bug 7011: First\n"),
|
||||
);
|
||||
crate::db::write_item_with_content(
|
||||
"7012_bug_second",
|
||||
"1_backlog",
|
||||
"---\nname: Second\n---\n# Bug 7012: Second\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Second\n---\n# Bug 7012: Second\n"),
|
||||
);
|
||||
|
||||
let result = list_bug_files(tmp.path()).unwrap();
|
||||
@@ -349,6 +369,7 @@ fn create_spike_file_increments_from_existing_items() {
|
||||
"7050_story_existing",
|
||||
"1_backlog",
|
||||
"---\nname: Existing\n---\n",
|
||||
crate::db::ItemMeta::from_yaml("---\nname: Existing\n---\n"),
|
||||
);
|
||||
|
||||
let spike_id = create_spike_file(tmp.path(), "My Spike", None, &[], None).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user