Skip to content

Commit

Permalink
Move pack fixtures into place which resembles an actual object db (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Apr 3, 2021
1 parent 1e727af commit fb5cea4
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions git-odb/src/zlib/stream/deflate/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ mod deflate_stream {
#[test]
fn big_file_small_writes() -> Result<(), Box<dyn std::error::Error>> {
let mut w = DeflateWriter::new(Vec::new());
let bytes =
include_bytes!("../../../../tests/fixtures/packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack");
let bytes = include_bytes!(
"../../../../tests/fixtures/objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
);
for chunk in bytes.chunks(2) {
assert_eq!(w.write(chunk)?, chunk.len());
}
Expand All @@ -38,8 +39,9 @@ mod deflate_stream {
#[test]
fn big_file_a_few_big_writes() -> Result<(), Box<dyn std::error::Error>> {
let mut w = DeflateWriter::new(Vec::new());
let bytes =
include_bytes!("../../../../tests/fixtures/packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack");
let bytes = include_bytes!(
"../../../../tests/fixtures/objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
);
for chunk in bytes.chunks(4096 * 9) {
assert_eq!(w.write(chunk)?, chunk.len());
}
Expand Down
12 changes: 6 additions & 6 deletions git-odb/tests/pack/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const SMALL_PACK_INDEX: &str = "packs/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.idx";
const SMALL_PACK: &str = "packs/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.pack";
const SMALL_PACK_INDEX: &str = "objects/pack/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.idx";
const SMALL_PACK: &str = "objects/pack/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.pack";

const INDEX_V1: &str = "packs/pack-c0438c19fb16422b6bbcce24387b3264416d485b.idx";
const PACK_FOR_INDEX_V1: &str = "packs/pack-c0438c19fb16422b6bbcce24387b3264416d485b.pack";
const INDEX_V1: &str = "objects/pack/pack-c0438c19fb16422b6bbcce24387b3264416d485b.idx";
const PACK_FOR_INDEX_V1: &str = "objects/pack/pack-c0438c19fb16422b6bbcce24387b3264416d485b.pack";

const INDEX_V2: &str = "packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.idx";
const PACK_FOR_INDEX_V2: &str = "packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack";
const INDEX_V2: &str = "objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.idx";
const PACK_FOR_INDEX_V2: &str = "objects/pack/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack";

const PACKS_AND_INDICES: &[(&'static str, &'static str)] =
&[(SMALL_PACK_INDEX, SMALL_PACK), (INDEX_V1, PACK_FOR_INDEX_V1)];
Expand Down

0 comments on commit fb5cea4

Please sign in to comment.