pub struct DecoderHarness<D> { /* private fields */ }
Expand description
Run decoder compliance tests
§Example
In Cargo.toml
:
[[test]]
name = "decoder_compliance"
harness = false
tests/decoder_compliance.rs
// mod decoder;
fn main() {
let decoder = decoder::Decoder;
let mut harness = toml_test_harness::DecoderHarness::new(decoder);
harness.version("1.0.0");
harness.ignore([]).unwrap();
harness.test();
}
Implementations§
Source§impl<D> DecoderHarness<D>
impl<D> DecoderHarness<D>
pub fn new(decoder: D) -> Self
pub fn ignore<'p>( &mut self, patterns: impl IntoIterator<Item = &'p str>, ) -> Result<&mut Self, Error>
pub fn version(&mut self, version: impl Into<String>) -> &mut Self
pub fn extend_valid( &mut self, cases: impl IntoIterator<Item = Valid<'static>>, ) -> &mut Self
pub fn extend_invalid( &mut self, cases: impl IntoIterator<Item = Invalid<'static>>, ) -> &mut Self
pub fn snapshot_root(&mut self, root: impl Into<PathBuf>) -> &mut Self
Available on crate feature
snapshot
only.pub fn test(self) -> !
Auto Trait Implementations§
impl<D> Freeze for DecoderHarness<D>where
D: Freeze,
impl<D> RefUnwindSafe for DecoderHarness<D>where
D: RefUnwindSafe,
impl<D> Send for DecoderHarness<D>where
D: Send,
impl<D> Sync for DecoderHarness<D>where
D: Sync,
impl<D> Unpin for DecoderHarness<D>where
D: Unpin,
impl<D> UnwindSafe for DecoderHarness<D>where
D: 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
Mutably borrows from an owned value. Read more