Enum FileFailurePersistence
pub enum FileFailurePersistence
Describes how failing test cases are persisted.
Note that file names in this enum are &str rather than &Path since
constant functions are not yet in Rust stable as of 2017-12-16.
In all cases, if a derived path references a directory which does not yet exist, proptest will attempt to create all necessary parent directories.
Variants
-
Off Completely disables persistence of failing test cases.
This is semantically equivalent to
Direct("/dev/null")on Unix andDirect("NUL")on Windows (though it is internally handled by simply not doing any I/O).-
SourceParallel(&'static str) The path of the source file under test is traversed up the directory tree until a directory containing a file named
lib.rsormain.rsis found. A sibling to that directory with the name given by the string in this configuration is created, and a file with the same name and path relative to the source directory, but with the extension changed to.txt, is used.For example, given a source path of
/home/jsmith/code/project/src/foo/bar.rsand a configuration ofSourceParallel("proptest-regressions")(the default), assuming thesrcdirectory has alib.rsormain.rs, the resulting file would be/home/jsmith/code/project/proptest-regressions/foo/bar.txt.If no
lib.rsormain.rscan be found, a warning is printed and this behaves likeWithSource.If no source file has been configured, a warning is printed and this behaves like
Off.-
WithSource(&'static str) Failures are persisted in a file with the same path as the source file under test, but the extension is changed to the string given in this configuration.
For example, given a source path of
/home/jsmith/code/project/src/foo/bar.rsand a configuration ofWithSource("regressions"), the resulting path would be/home/jsmith/code/project/src/foo/bar.regressions.-
Direct(&'static str) The string given in this option is directly used as a file path without any further processing.
Trait Implementations
impl Clone for FileFailurePersistence
fn clone(&self) -> Self
impl Copy for FileFailurePersistence
impl Debug for FileFailurePersistence
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for FileFailurePersistence
fn default() -> Self
impl FailurePersistence for FileFailurePersistence
fn load_persisted_failures2(&self, source_file: Option<&'static str>) -> Vec<PersistedSeed>fn save_persisted_failure2(&mut self, source_file: Option<&'static str>, seed: PersistedSeed, shrunken_value: &dyn Debug)fn box_clone(&self) -> Box<dyn FailurePersistence>fn eq(&self, other: &dyn FailurePersistence) -> boolfn as_any(&self) -> &dyn Any
impl PartialEq for FileFailurePersistence
fn eq(&self, other: &Self) -> bool