From ea8dc9abb1317ed714af47ae4d6795055914a5c0 Mon Sep 17 00:00:00 2001 From: pasta Date: Sat, 22 Jan 2022 16:03:49 +0700 Subject: [PATCH] test: better check the results of abort_transaction --- grovedb/src/tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/grovedb/src/tests.rs b/grovedb/src/tests.rs index 5b58531a7..00e4a1cda 100644 --- a/grovedb/src/tests.rs +++ b/grovedb/src/tests.rs @@ -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());