()
| 10 | |
| 11 | #[test] |
| 12 | fn test_register_change() { |
| 13 | let dir = tempdir().unwrap(); |
| 14 | let db_path = dir.path().join("pristine"); |
| 15 | let pristine = Pristine::open(&db_path).unwrap(); |
| 16 | |
| 17 | let mut txn = pristine.write_txn().unwrap(); |
| 18 | let hash = Hash::of(b"test change"); |
| 19 | let id = txn.register_change(&hash).unwrap(); |
| 20 | |
| 21 | // Should get same ID for same hash |
| 22 | let id2 = txn.register_change(&hash).unwrap(); |
| 23 | assert_eq!(id, id2); |
| 24 | |
| 25 | // Should be able to look up both ways |
| 26 | assert_eq!(txn.get_external(id).unwrap(), Some(hash)); |
| 27 | assert_eq!(txn.get_internal(&hash).unwrap(), Some(id)); |
| 28 | |
| 29 | txn.commit().unwrap(); |
| 30 | } |
| 31 | |
| 32 | #[test] |
| 33 | fn test_view_operations() { |
nothing calls this directly
no test coverage detected