MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_abort_transaction

Function test_abort_transaction

atomic-core/src/pristine/txn/write/tests.rs:649–664  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

647
648 #[test]
649 fn test_abort_transaction() {
650 let dir = tempdir().unwrap();
651 let db_path = dir.path().join("pristine");
652 let pristine = Pristine::open(&db_path).unwrap();
653
654 // Create a view, then abort
655 {
656 let mut txn = pristine.write_txn().unwrap();
657 txn.open_or_create_view("test_view").unwrap();
658 txn.abort().unwrap();
659 }
660
661 // View should not exist
662 let txn = pristine.read_txn().unwrap();
663 assert!(txn.get_view("test_view").unwrap().is_none());
664 }
665
666 // Directory Tracking Tests
667

Callers

nothing calls this directly

Calls 6

write_txnMethod · 0.80
open_or_create_viewMethod · 0.80
abortMethod · 0.80
read_txnMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected