pub struct TestCases { /* private fields */ }
Implementations§
source§impl TestCases
impl TestCases
pub fn new() -> Self
sourcepub fn with_suffix(suffix: impl Into<OsString>) -> Self
pub fn with_suffix(suffix: impl Into<OsString>) -> Self
Will add a custom suffix to stderr files.
This can be useful to test both nightly and stable outputs.
#[rustversion::nightly]
fn nightly() {
let runner = TestCases::with_suffix("nightly");
// ...
}
#[rustversion::stable]
fn stable() {
let runner = TestCases::with_suffix("stable");
// ...
}
pub fn pass<P: AsRef<Path>>(&self, path: P)
pub fn pass_inline(&self, name: &str, code: &str)
pub fn pass_check_sub<P: AsRef<Path>>(&self, path: P, sub_string: &str)
pub fn pass_inline_check_sub(&self, name: &str, code: &str, sub_string: &str)
pub fn compile_fail<P: AsRef<Path>>(&self, path: P)
pub fn compile_fail_inline<P: AsRef<Path>>( &self, name: &str, code: &str, stderr_path: P )
pub fn compile_fail_check_sub<P: AsRef<Path>>(&self, path: P, sub_string: &str)
pub fn compile_fail_inline_check_sub( &self, name: &str, code: &str, sub_string: &str )
Trait Implementations§
Auto Trait Implementations§
impl Send for TestCases
impl !Sync for TestCases
impl Unpin for TestCases
impl UnwindSafe for TestCases
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