diff options
author | Florian Klink <flokli@flokli.de> | 2023-01-06T15·27+0100 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-01-06T15·39+0000 |
commit | c89af03a030b8447954d17972ce6f64fb6d42f57 (patch) | |
tree | 252edef441896ec9ce3111c663d5d576e76e3379 /tvix/store/src/tests | |
parent | 999afd4be27619657a10d3031f289f627bb029b1 (diff) |
refactor(tvix/store): rename NixPath to StorePath r/5613
As discussed in #tvl, this is a more common term for it. Change-Id: I9b904222b8c076f82192c9b7f0b42be171614ab7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7776 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/tests')
-rw-r--r-- | tvix/store/src/tests/pathinfo.rs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tvix/store/src/tests/pathinfo.rs b/tvix/store/src/tests/pathinfo.rs index 8f4e9d399084..a278cf5e8eb0 100644 --- a/tvix/store/src/tests/pathinfo.rs +++ b/tvix/store/src/tests/pathinfo.rs @@ -1,6 +1,6 @@ use crate::{ - nixpath::{NixPath, ParseNixPathError}, proto::{self, Node, PathInfo, ValidatePathInfoError}, + store_path::{ParseStorePathError, StorePath}, }; use lazy_static::lazy_static; use test_case::test_case; @@ -30,7 +30,10 @@ const DUMMY_NAME: &str = "00000000000000000000000000000000-dummy"; Err(ValidatePathInfoError::NoNodePresent()); "No node 2" )] -fn validate_no_node(t_node: Option<proto::Node>, t_result: Result<NixPath, ValidatePathInfoError>) { +fn validate_no_node( + t_node: Option<proto::Node>, + t_result: Result<StorePath, ValidatePathInfoError>, +) { // construct the PathInfo object let p = PathInfo { node: t_node, @@ -45,7 +48,7 @@ fn validate_no_node(t_node: Option<proto::Node>, t_result: Result<NixPath, Valid digest: DUMMY_DIGEST.to_vec(), size: 0, }, - Ok(NixPath::from_string(DUMMY_NAME).expect("must succeed")); + Ok(StorePath::from_string(DUMMY_NAME).expect("must succeed")); "ok" )] #[test_case( @@ -65,13 +68,13 @@ fn validate_no_node(t_node: Option<proto::Node>, t_result: Result<NixPath, Valid }, Err(ValidatePathInfoError::InvalidNodeName( "invalid".to_string(), - ParseNixPathError::InvalidName("".to_string()) + ParseStorePathError::InvalidName("".to_string()) )); "invalid node name" )] fn validate_directory( t_directory_node: proto::DirectoryNode, - t_result: Result<NixPath, ValidatePathInfoError>, + t_result: Result<StorePath, ValidatePathInfoError>, ) { // construct the PathInfo object let p = PathInfo { @@ -90,7 +93,7 @@ fn validate_directory( size: 0, executable: false, }, - Ok(NixPath::from_string(DUMMY_NAME).expect("must succeed")); + Ok(StorePath::from_string(DUMMY_NAME).expect("must succeed")); "ok" )] #[test_case( @@ -110,11 +113,11 @@ fn validate_directory( }, Err(ValidatePathInfoError::InvalidNodeName( "invalid".to_string(), - ParseNixPathError::InvalidName("".to_string()) + ParseStorePathError::InvalidName("".to_string()) )); "invalid node name" )] -fn validate_file(t_file_node: proto::FileNode, t_result: Result<NixPath, ValidatePathInfoError>) { +fn validate_file(t_file_node: proto::FileNode, t_result: Result<StorePath, ValidatePathInfoError>) { // construct the PathInfo object let p = PathInfo { node: Some(Node { @@ -130,7 +133,7 @@ fn validate_file(t_file_node: proto::FileNode, t_result: Result<NixPath, Validat name: DUMMY_NAME.to_string(), ..Default::default() }, - Ok(NixPath::from_string(DUMMY_NAME).expect("must succeed")); + Ok(StorePath::from_string(DUMMY_NAME).expect("must succeed")); "ok" )] #[test_case( @@ -140,13 +143,13 @@ fn validate_file(t_file_node: proto::FileNode, t_result: Result<NixPath, Validat }, Err(ValidatePathInfoError::InvalidNodeName( "invalid".to_string(), - ParseNixPathError::InvalidName("".to_string()) + ParseStorePathError::InvalidName("".to_string()) )); "invalid node name" )] fn validate_symlink( t_symlink_node: proto::SymlinkNode, - t_result: Result<NixPath, ValidatePathInfoError>, + t_result: Result<StorePath, ValidatePathInfoError>, ) { // construct the PathInfo object let p = PathInfo { |