pub enum GoldenError {
Missing {
path: PathBuf,
actual: String,
},
Mismatch {
path: PathBuf,
expected: String,
actual: String,
},
Unreadable {
path: PathBuf,
detail: String,
},
Unwritable {
path: PathBuf,
detail: String,
},
Unrenderable {
path: PathBuf,
detail: String,
},
}Expand description
The reason a golden check failed, returned by check_text_golden and
check_json_golden.
Its Display text is the message assert_text_golden and
assert_json_golden panic with. The message of a missing or mismatching
file includes the actual output (and the expected output), and says how to
rewrite the file.
Variants§
Missing
The golden file does not exist. actual is the output that update mode
would write to it.
Mismatch
The actual output differs from the golden file.
Fields
Unreadable
The golden file exists but cannot be read, or a JSON golden file’s text
is not the JSON form of a serialized value. from_json lists every
such case; one of them is valid JSON that nests deeper than
SerialValue::MAX_NESTING_DEPTH.
Unwritable
The golden file cannot be written in update mode.
Unrenderable
The actual value of a JSON comparison has no JSON form: it holds a map
key beginning with $, a prefix techy reserves.
Trait Implementations§
Source§impl Clone for GoldenError
impl Clone for GoldenError
Source§impl Debug for GoldenError
impl Debug for GoldenError
Source§impl Display for GoldenError
impl Display for GoldenError
impl Eq for GoldenError
Source§impl Error for GoldenError
impl Error for GoldenError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for GoldenError
impl PartialEq for GoldenError
impl StructuralPartialEq for GoldenError
Auto Trait Implementations§
impl Forget for GoldenError
impl Freeze for GoldenError
impl Move for GoldenError
impl RefUnwindSafe for GoldenError
impl Send for GoldenErrorwhere
RawVecInner: Send,
impl Sync for GoldenErrorwhere
RawVecInner: Sync,
impl Unpin for GoldenError
impl UnsafeUnpin for GoldenError
impl UnwindSafe for GoldenErrorwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more