Skip to content

Commit

Permalink
Merge pull request #39 from PastaPastaPasta/check-results-of-call-in-…
Browse files Browse the repository at this point in the history
…test

test: better check the results of abort_transaction
  • Loading branch information
QuantumExplorer authored Jan 26, 2022
2 parents e146b16 + ea8dc9a commit 17e0b6d
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 @@ -943,7 +943,15 @@ fn transaction_should_be_aborted() {
)
.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 17e0b6d

Please sign in to comment.