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

Function test_read_empty_database

atomic-core/src/pristine/txn/read.rs:2194–2206  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2192
2193 #[test]
2194 fn test_read_empty_database() {
2195 let dir = tempdir().unwrap();
2196 let db_path = dir.path().join("pristine");
2197 let pristine = Pristine::open(&db_path).unwrap();
2198
2199 let txn = pristine.read_txn().unwrap();
2200
2201 // Empty database should return None for lookups
2202 assert!(txn.get_external(NodeId::new(1)).unwrap().is_none());
2203 assert!(txn.get_view("main").unwrap().is_none());
2204 assert!(txn.get_inode("test.txt").unwrap().is_none());
2205 assert!(txn.list_views().unwrap().is_empty());
2206 }
2207}

Callers

nothing calls this directly

Calls 3

read_txnMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected