Struct regex_test::RegexTests
source · pub struct RegexTests { /* private fields */ }
Expand description
A collection of regex tests.
Implementations§
source§impl RegexTests
impl RegexTests
sourcepub fn new() -> RegexTests
pub fn new() -> RegexTests
Create a new empty collection of glob tests.
sourcepub fn load<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn load<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Loads all of the tests in the given TOML file. The group name assigned
to each test is the stem of the file name. For example, if one loads
foo/bar.toml
, then the group name for each test will be bar
.
sourcepub fn load_slice(&mut self, group_name: &str, data: &[u8]) -> Result<()>
pub fn load_slice(&mut self, group_name: &str, data: &[u8]) -> Result<()>
Load all of the TOML encoded tests in data
into this collection.
The given group name is assigned to all loaded tests.
sourcepub fn iter(&self) -> RegexTestsIter<'_> ⓘ
pub fn iter(&self) -> RegexTestsIter<'_> ⓘ
Return an iterator over all regex tests that have been loaded. The order of the iterator corresponds to the order in which the tests were loaded.
This is useful to pass to TestRunner::test_iter
.
Trait Implementations§
source§impl Clone for RegexTests
impl Clone for RegexTests
source§fn clone(&self) -> RegexTests
fn clone(&self) -> RegexTests
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RegexTests
impl Debug for RegexTests
source§impl<'de> Deserialize<'de> for RegexTests
impl<'de> Deserialize<'de> for RegexTests
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for RegexTests
impl Send for RegexTests
impl Sync for RegexTests
impl Unpin for RegexTests
impl UnwindSafe for RegexTests
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