/// Execute the test here and now, return None for success or Some reason to fail.
Execute the test here and now, return None for success or Some reason to fail.
Execute the test here and now return None for success or Some reason to fail .
fn is_failure(&self, runner: TestRunner) -> Option<&'static str> {
        let runner = if let Some(precision) = self.options.precision {
            runner.set_precision(precision as usize)
        } else {
            runner
        };
        match (&self.expectation, runner.run(&self.input)) {
            (ExpectedError(_), Ok(_)) => Some("missing error"),
            (ExpectedError(ref expected), Err(ref actual)) => {
                // TODO: some flexibility in comparision?
                if expected == actual {
                    None
                } else {
                    Some("wrong error")
                }
            }
            (ExpectedCSS(ref expected), Ok(ref actual)) => {
                if expected == actual {
                    None
                } else {
                    Some("wrong result")
                }
            }
            (ExpectedCSS(_), Err(_)) => Some("unexepected error"),
        }
    }
fn is_failure ( & self , runner : TestRunner ) -> Option < & ' static str > { let runner = if let Some ( precision ) = self . options . precision { runner . set_precision ( precision as usize ) } else { runner } ; match ( & self . expectation , runner . run ( & self . input ) ) { ( ExpectedError ( _ ) , Ok ( _ ) ) => Some ( " " ) , ( ExpectedError ( ref expected ) , Err ( ref actual ) ) => { // TODO: some flexibility in comparision? if expected == actual { None } else { Some ( " " ) } } ( ExpectedCSS ( ref expected ) , Ok ( ref actual ) ) => { if expected == actual { None } else { Some ( " " ) } } ( ExpectedCSS ( _ ) , Err ( _ ) ) => Some ( " " ) , } }
Execute the test here and now, return None for success or Some reason to fail.
Execute the test here and now return None for success or Some reason to fail .
&self
runner
TestRunner