Skip to content

Commit

Permalink
test: better check the results of abort_transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Jan 23, 2022
1 parent 1563eaf commit ea8dc9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions grovedb/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,15 @@ fn transaction_should_be_aborted() {
Some(&transaction),
).unwrap();

assert!(db.is_readonly);
assert!(db.temp_root_tree.leaves_len() > 0);
assert!(!db.temp_root_leaf_keys.is_empty());
assert!(!db.temp_subtrees.is_empty());
db.abort_transaction(transaction).unwrap();
assert!(!db.is_readonly);
assert_eq!(db.temp_root_tree.leaves_len(), 0);
assert!(db.temp_root_leaf_keys.is_empty());
assert!(db.temp_subtrees.is_empty());

// Transaction should be closed
assert!(!db.is_transaction_started());
Expand Down

0 comments on commit ea8dc9a

Please sign in to comment.