|
| 1 | +use git_actor::{Sign, Time}; |
| 2 | +use git_object::bstr::ByteSlice; |
| 3 | + |
1 | 4 | use git_odb::loose::Store;
|
2 | 5 | use pretty_assertions::assert_eq;
|
3 | 6 |
|
@@ -29,10 +32,18 @@ pub fn locate_oid(id: git_hash::ObjectId, buf: &mut Vec<u8>) -> git_object::Data
|
29 | 32 | ldb().try_find(id, buf).expect("read success").expect("id present")
|
30 | 33 | }
|
31 | 34 |
|
| 35 | +#[test] |
| 36 | +#[ignore] |
| 37 | +fn verify_integrity() { |
| 38 | + let db = ldb(); |
| 39 | + let outcome = db.verify_integrity().unwrap(); |
| 40 | + assert_eq!(outcome.num_objects, 42); |
| 41 | +} |
| 42 | + |
32 | 43 | mod write {
|
33 | 44 | use git_odb::{loose, Write};
|
34 | 45 |
|
35 |
| - use crate::store::loose::backend::{locate_oid, object_ids}; |
| 46 | + use crate::store::loose::{locate_oid, object_ids}; |
36 | 47 |
|
37 | 48 | #[test]
|
38 | 49 | fn read_and_write() -> Result<(), Box<dyn std::error::Error>> {
|
@@ -66,8 +77,7 @@ mod locate {
|
66 | 77 | use crate::{
|
67 | 78 | hex_to_id,
|
68 | 79 | store::loose::{
|
69 |
| - backend::{ldb, locate_oid}, |
70 |
| - signature, |
| 80 | + signature, {ldb, locate_oid}, |
71 | 81 | },
|
72 | 82 | };
|
73 | 83 |
|
@@ -210,3 +220,15 @@ cjHJZXWmV4CcRfmLsXzU8s2cR9A0DBvOxhPD1TlKC2JhBFXigjuL9U4Rbq9tdegB
|
210 | 220 | Ok(())
|
211 | 221 | }
|
212 | 222 | }
|
| 223 | + |
| 224 | +fn signature(time: u32) -> git_actor::SignatureRef<'static> { |
| 225 | + git_actor::SignatureRef { |
| 226 | + name: b"Sebastian Thiel".as_bstr(), |
| 227 | + email: b"[email protected]".as_bstr(), |
| 228 | + time: Time { |
| 229 | + time, |
| 230 | + offset: 7200, |
| 231 | + sign: Sign::Plus, |
| 232 | + }, |
| 233 | + } |
| 234 | +} |
0 commit comments