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 and Direct("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.rs or main.rs is 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.rs and a configuration of SourceParallel("proptest-regressions") (the default), assuming the src directory has a lib.rs or main.rs, the resulting file would be /home/jsmith/code/project/proptest-regressions/foo/bar.txt.

If no lib.rs or main.rs can be found, a warning is printed and this behaves like WithSource.

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.rs and a configuration of WithSource("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) -> FileFailurePersistence

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) -> bool
fn as_any(&self) -> &dyn Any

impl PartialEq for FileFailurePersistence

fn eq(&self, other: &FileFailurePersistence) -> bool

impl StructuralPartialEq for FileFailurePersistence

Auto Trait Implementations

impl Freeze for FileFailurePersistence

impl RefUnwindSafe for FileFailurePersistence

impl Send for FileFailurePersistence

impl Sync for FileFailurePersistence

impl Unpin for FileFailurePersistence

impl UnsafeUnpin for FileFailurePersistence

impl UnwindSafe for FileFailurePersistence

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for FileFailurePersistence where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for FileFailurePersistence where ST: ?Sized, DT: ?Sized,

impl<T> Any for FileFailurePersistence where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for FileFailurePersistence where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for FileFailurePersistence where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for FileFailurePersistence where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for FileFailurePersistence

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Read<Exclusive, BecauseExclusive> for FileFailurePersistence where T: ?Sized,

impl<T> ToOwned for FileFailurePersistence where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for FileFailurePersistence where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for FileFailurePersistence where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for FileFailurePersistence where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip<V> for FileFailurePersistence where V: MultiLane<T>,

fn vzip(self) -> V