Unified · Split
| @@ -102,6 +102,7 @@ check: ## Build all code in suitable configurations · 101 unmodified lines | ||
| 102 | 102 | unit-tests: ## run all unit tests |
| 103 | 103 | cargo test --all --no-fail-fast |
| 104 | 104 | cd git-features && cargo test && cargo test --all-features |
| 105 | + cd git-odb && cargo test && cargo test --all-features | |
| 105 | 106 | cd git-transport && cargo test && cargo test --features http-client-curl |
| 106 | 107 | cd gitoxide-core && cargo test --lib |
| 107 | 108 | |
| @@ -160,7 +160,7 @@ pub mod reduce { · 159 unmodified lines | ||
| 160 | 160 | }; |
| 161 | 161 | } |
| 162 | 162 | if let Some(thread_err) = last_err { |
| 163 | − std::panic::panic_any(thread_err); | |
| 163 | + std::panic::resume_unwind(thread_err); | |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | } |
| @@ -16,6 +16,17 @@ default = ["flate2/zlib-ng-compat"] · 15 unmodified lines | ||
| 16 | 16 | pack-cache-lru-static = ["uluru"] |
| 17 | 17 | pack-cache-lru-dynamic = ["memory-lru"] |
| 18 | 18 | serde1 = ["serde", "git-object/serde1"] |
| 19 | +internal-testing-git-features-parallel = ["git-features/parallel"] | |
| 20 | + | |
| 21 | +[[test]] | |
| 22 | +name = "multi-threaded-odb" | |
| 23 | +path = "tests/odb.rs" | |
| 24 | +required-features = ["internal-testing-git-features-parallel"] | |
| 25 | + | |
| 26 | +[[test]] | |
| 27 | +name = "single-threaded-odb" | |
| 28 | +path = "tests/odb.rs" | |
| 29 | +required-features = [] | |
| 19 | 30 | |
| 20 | 31 | [package.metadata.docs.rs] |
| 21 | 32 | all-features = true |
| @@ -115,6 +115,8 @@ where · 114 unmodified lines | ||
| 115 | 115 | move |oid, (buf, cache)| { |
| 116 | 116 | let _obj = db.locate(oid.as_ref(), buf, cache)?; |
| 117 | 117 | let _ = version; // currently unused |
| 118 | + todo!("entry generation"); | |
| 119 | + #[allow(unreachable_code)] | |
| 118 | 120 | Ok(Vec::new()) |
| 119 | 121 | }, |
| 120 | 122 | parallel::reduce::IdentityWithResult::default(), |
| @@ -17,23 +17,27 @@ mod simple_compression { · 16 unmodified lines | ||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | #[test] |
| 20 | − fn all_input_objects() -> crate::Result { | |
| 21 | − let db = db(DbKind::AbunchOfRandomObjects)?; | |
| 22 | − let obj_count = db.iter().count(); | |
| 23 | − assert_eq!(obj_count, 146); | |
| 24 | − let all_objects = db.arc_iter().flat_map(Result::ok); | |
| 25 | − let entries: Vec<_> = pack::data::encode::entries( | |
| 26 | − db.clone(), | |
| 27 | − all_objects, | |
| 28 | − progress::Discard, | |
| 29 | − pack::data::encode::Options::default(), | |
| 30 | − ) | |
| 31 | − .collect::<Result<Vec<_>, _>>()? | |
| 32 | − .into_iter() | |
| 33 | − .flatten() | |
| 34 | − .collect(); | |
| 35 | − // assert_eq!(entries.len(), obj_count, "each object gets one entry"); | |
| 36 | − assert_eq!(entries.len(), 0, "each object gets one entry"); | |
| 37 | − Ok(()) | |
| 20 | + #[should_panic] | |
| 21 | + fn all_input_objects() { | |
| 22 | + (|| -> Result<(), Box<dyn std::error::Error>> { | |
| 23 | + let db = db(DbKind::AbunchOfRandomObjects)?; | |
| 24 | + let obj_count = db.iter().count(); | |
| 25 | + assert_eq!(obj_count, 146); | |
| 26 | + let all_objects = db.arc_iter().flat_map(Result::ok); | |
| 27 | + let entries: Vec<_> = pack::data::encode::entries( | |
| 28 | + db.clone(), | |
| 29 | + all_objects, | |
| 30 | + progress::Discard, | |
| 31 | + pack::data::encode::Options::default(), | |
| 32 | + ) | |
| 33 | + .collect::<Result<Vec<_>, _>>()? | |
| 34 | + .into_iter() | |
| 35 | + .flatten() | |
| 36 | + .collect(); | |
| 37 | + // assert_eq!(entries.len(), obj_count, "each object gets one entry"); | |
| 38 | + assert_eq!(entries.len(), 0, "each object gets one entry"); | |
| 39 | + Ok(()) | |
| 40 | + })() | |
| 41 | + .unwrap(); | |
| 38 | 42 | } |
| 39 | 43 | } |