pub struct TestCase {
pub commands: Vec<String>,
pub cargo_bin_alias: String,
pub cargo_bin_name: Option<String>,
pub test_dir: Option<PathBuf>,
pub output: ExpectedOutput,
pub envs: Vec<(OsString, OsString)>,
}Fields§
§commands: Vec<String>§cargo_bin_alias: String§cargo_bin_name: Option<String>§test_dir: Option<PathBuf>§output: ExpectedOutput§envs: Vec<(OsString, OsString)>Implementations§
Source§impl TestCase
impl TestCase
pub fn parse( source: impl AsRef<str>, source_path: Option<PathBuf>, source_line: Option<usize>, ) -> Self
pub fn with_cargo_bin_alias( self, alias: impl Into<String>, cargo_bin_name: Option<impl Into<String>>, ) -> Self
pub fn set_cargo_bin_alias( &mut self, alias: impl Into<String>, cargo_bin_name: Option<impl Into<String>>, )
pub fn with_test_dir(self, test_dir: impl Into<PathBuf>) -> Self
pub fn with_env( self, key: impl Into<OsString>, val: impl Into<OsString>, ) -> Self
pub fn with_envs( self, vars: impl IntoIterator<Item = (impl Into<OsString>, impl Into<OsString>)>, ) -> Self
pub fn push_envs( &mut self, vars: impl IntoIterator<Item = (impl Into<OsString>, impl Into<OsString>)>, )
pub fn run(&self) -> Result<()>
pub fn assert_command_output( &self, root_dir: impl AsRef<Path>, command: impl AsRef<str>, output: impl AsRef<str>, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestCase
impl RefUnwindSafe for TestCase
impl Send for TestCase
impl Sync for TestCase
impl Unpin for TestCase
impl UnwindSafe for TestCase
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