types: add mocks for RepoPathBuf

Summary: This will be used in transitioning key from bytes to repo path.

Reviewed By: quark-zju

Differential Revision: D14877548

fbshipit-source-id: f79863469d58b53557e51ebb033cc6a6b5f43499
This commit is contained in:
Stefan Filip 2019-04-14 19:51:34 -07:00 committed by Facebook Github Bot
parent cca46940f6
commit bec1a1d3e0

View File

@ -515,6 +515,21 @@ impl quickcheck::Arbitrary for PathComponentBuf {
}
}
#[cfg(any(test, feature = "for-tests"))]
pub mod mocks {
use super::*;
use lazy_static::lazy_static;
lazy_static! {
pub static ref FOO_PATH: RepoPathBuf =
RepoPathBuf::from_string(String::from("foo")).unwrap();
pub static ref BAR_PATH: RepoPathBuf =
RepoPathBuf::from_string(String::from("bar")).unwrap();
pub static ref BAZ_PATH: RepoPathBuf =
RepoPathBuf::from_string(String::from("baz")).unwrap();
}
}
#[cfg(test)]
mod tests {
use super::*;