-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ArchiveDB and other small fixes #5867
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,6 +239,21 @@ mod tests { | |
jdb.commit_batch(3, &b"3".sha3(), Some((0, b"0".sha3()))).unwrap(); | ||
assert!(jdb.contains(&h)); | ||
jdb.commit_batch(4, &b"4".sha3(), Some((1, b"1".sha3()))).unwrap(); | ||
assert!(jdb.contains(&h)); | ||
} | ||
|
||
#[test] | ||
#[should_panic] | ||
fn multiple_owed_removal_not_allowed() { | ||
let mut jdb = ArchiveDB::new_temp(); | ||
let h = jdb.insert(b"foo"); | ||
jdb.commit_batch(0, &b"0".sha3(), None).unwrap(); | ||
assert!(jdb.contains(&h)); | ||
jdb.remove(&h); | ||
jdb.remove(&h); | ||
// commit_batch would call journal_under(), | ||
// and we don't allow multiple owned removals. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. semantics of journaldb are a little weird as it never deletes the key from the backing store, so it actually wouldn't panic if the two removals were done on opposite sides of a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I deliberately remove twice in a single batch and so mark this test as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can't hurt to have the test case -- it will let us know if that behavior changes. |
||
jdb.commit_batch(1, &b"1".sha3(), None).unwrap(); | ||
} | ||
|
||
#[test] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea to check that unicode works fully :)