refactor(tvix): condense long bytestrings

Change-Id: I3bea0827ec2c8db835334ce378a7bf3a39e9b1a3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9849
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
edef 2023-10-27 01:12:26 +00:00
parent 55c37a2871
commit 6a0a75c8e1
11 changed files with 66 additions and 92 deletions

View file

@ -210,6 +210,7 @@ mod tests {
use crate::nixbase32;
use crate::store_path::{DIGEST_SIZE, ENCODED_DIGEST_SIZE};
use hex_literal::hex;
use test_case::test_case;
use super::{Error, StorePath};
@ -226,10 +227,7 @@ mod tests {
let nixpath = StorePath::from_bytes(example_nix_path_str.as_bytes())
.expect("Error parsing example string");
let expected_digest: [u8; DIGEST_SIZE] = [
0x8a, 0x12, 0x32, 0x15, 0x22, 0xfd, 0x91, 0xef, 0xbd, 0x60, 0xeb, 0xb2, 0x48, 0x1a,
0xf8, 0x85, 0x80, 0xf6, 0x16, 0x00,
];
let expected_digest: [u8; DIGEST_SIZE] = hex!("8a12321522fd91efbd60ebb2481af88580f61600");
assert_eq!("net-tools-1.60_p20170221182432", nixpath.name);
assert_eq!(nixpath.digest, expected_digest);