diff options
author | Florian Klink <flokli@flokli.de> | 2023-02-27T08·12+0100 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-03-10T10·58+0000 |
commit | e7279b6063b3a4675f8ed37c797254de8a0c79e9 (patch) | |
tree | f1eec4e519af00e8798eeacd76919f696c13e557 /tvix/store/src/tests/nar_renderer.rs | |
parent | 28a862976bd43912e0e5dc16e8919590c36f4cf0 (diff) |
refactor(tvix/store/tests): move fixtures into separate module r/5929
Change-Id: I362dbf0899e4dc42114fd2e6a8fa7f537e9ea138 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8156 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/store/src/tests/nar_renderer.rs')
-rw-r--r-- | tvix/store/src/tests/nar_renderer.rs | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/tvix/store/src/tests/nar_renderer.rs b/tvix/store/src/tests/nar_renderer.rs index 4a72be5910fd..52cf43e9886d 100644 --- a/tvix/store/src/tests/nar_renderer.rs +++ b/tvix/store/src/tests/nar_renderer.rs @@ -6,46 +6,10 @@ use crate::proto; use crate::proto::DirectoryNode; use crate::proto::FileNode; use crate::proto::SymlinkNode; +use crate::tests::fixtures::*; use crate::tests::utils::*; -use lazy_static::lazy_static; use tempfile::TempDir; -const HELLOWORLD_BLOB_CONTENTS: &[u8] = b"Hello World!"; -const EMPTY_BLOB_CONTENTS: &[u8] = b""; - -lazy_static! { - static ref HELLOWORLD_BLOB_DIGEST: Vec<u8> = - blake3::hash(HELLOWORLD_BLOB_CONTENTS).as_bytes().to_vec(); - static ref EMPTY_BLOB_DIGEST: Vec<u8> = blake3::hash(EMPTY_BLOB_CONTENTS).as_bytes().to_vec(); - static ref DIRECTORY_WITH_KEEP: proto::Directory = proto::Directory { - directories: vec![], - files: vec![FileNode { - name: ".keep".to_string(), - digest: EMPTY_BLOB_DIGEST.to_vec(), - size: 0, - executable: false, - }], - symlinks: vec![], - }; - static ref DIRECTORY_COMPLICATED: proto::Directory = proto::Directory { - directories: vec![DirectoryNode { - name: "keep".to_string(), - digest: DIRECTORY_WITH_KEEP.digest(), - size: DIRECTORY_WITH_KEEP.size(), - }], - files: vec![FileNode { - name: ".keep".to_string(), - digest: EMPTY_BLOB_DIGEST.to_vec(), - size: 0, - executable: false, - }], - symlinks: vec![SymlinkNode { - name: "aa".to_string(), - target: "/nix/store/somewhereelse".to_string(), - }], - }; -} - #[test] fn single_symlink() { let tmpdir = TempDir::new().unwrap(); |