test(profiles): cover a v0.15-v0.17 secondary profile without history (#390)
The released-states loop stops at v0.10-v0.14 (state E). State F, the consolidated schema of v0.15.0 to v0.17.0 without a history, only had its floor checked; this test runs the whole preparation on it: history recorded up to v17, nothing applied, no copy, flag repaired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
02fca2ad3c
commit
71147c5083
1 changed files with 24 additions and 0 deletions
|
|
@ -851,6 +851,30 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_profile_from_v0_15_to_v0_17_gets_its_history_and_nothing_else() {
|
||||
// State F: created with the current consolidated schema, before #390
|
||||
// wrote a history. Nothing to apply, so no copy either; the flag is
|
||||
// still repaired.
|
||||
let dir = unique_dir("state-f");
|
||||
let path = create_db(&dir, SECONDARY, &[crate::database::CONSOLIDATED_SCHEMA]);
|
||||
let category = seed_user_rows(&open(&path));
|
||||
|
||||
let report = prepare_at(&path, SECONDARY, &migrations()).unwrap();
|
||||
|
||||
assert_eq!(report.catch_up_error, None);
|
||||
let done = report.catch_up.unwrap();
|
||||
assert_eq!(done.floor, Some(17));
|
||||
assert_eq!(done.recorded, versions(1, max_version()));
|
||||
assert!(done.applied.is_empty());
|
||||
assert_eq!(done.backup_file, None);
|
||||
assert_eq!(report.repaired_flags, 1);
|
||||
let conn = open(&path);
|
||||
assert_history_complete(&conn, "state F");
|
||||
assert_eq!(count(&conn, "SELECT category_id FROM transactions"), category);
|
||||
assert!(!dir.join(MIGRATION_BACKUP_DIR).exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_bilan_data_of_a_v0_9_profile_is_converted() {
|
||||
for state in released_states().into_iter().filter(|s| s.floor == 10) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue