Skip to content

Commit

Permalink
one more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-François <[email protected]>
  • Loading branch information
bilboquet committed Apr 18, 2024
1 parent 2fbfede commit 92bcb49
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/tests/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,31 @@ fn merge_conflict_commited_noncommited_vs_commited_noncommited() {
),
}
}

#[test]
fn merge_nonconflict_commited_vs_commited() {
let db = create_rocks_db(tempfile::tempdir().unwrap().path()).unwrap();
let (identifier, mut bonsai_storage, mut bonsai_at_txn, mut id_builder, _) = init_test(&db);

bonsai_storage
.insert(&identifier, &PAIR2.0, &PAIR2.1)
.unwrap();
bonsai_storage.commit(id_builder.new_id()).unwrap();

bonsai_at_txn
.insert(&identifier, &PAIR3.0, &PAIR3.1)
.unwrap();
bonsai_at_txn
.transactional_commit(id_builder.new_id())
.unwrap();

match bonsai_storage.merge(bonsai_at_txn) {
Ok(_) => {
panic!("Expected merge conflict error")
}
Err(err) => assert_eq!(
err.to_string(),
"Merge error: Transaction created_at BasicId(0) is lower than the last recorded id"
),
}
}

0 comments on commit 92bcb49

Please sign in to comment.