Lines Matching full:testresult
112 pub fn quicktest<A>(&mut self, f: A) -> Result<u64, TestResult> in quicktest()
122 TestResult { status: Pass, .. } => n_tests_passed += 1, in quicktest()
123 TestResult { status: Discard, .. } => continue, in quicktest()
124 r @ TestResult { status: Fail, .. } => return Err(r), in quicktest()
188 /// All testable things must be capable of producing a `TestResult`.
190 pub struct TestResult { struct
204 impl TestResult { impl
206 pub fn passed() -> TestResult { in passed()
207 TestResult::from_bool(true) in passed()
211 pub fn failed() -> TestResult { in failed()
212 TestResult::from_bool(false) in failed()
216 pub fn error<S: Into<String>>(msg: S) -> TestResult { in error() argument
217 let mut r = TestResult::from_bool(false); in error()
226 pub fn discard() -> TestResult { in discard()
227 TestResult { status: Discard, arguments: vec![], err: None } in discard()
230 /// Converts a `bool` to a `TestResult`. A `true` value indicates that
233 pub fn from_bool(b: bool) -> TestResult { in from_bool() argument
234 TestResult { in from_bool()
243 pub fn must_fail<T, F>(f: F) -> TestResult in must_fail()
250 TestResult::from_bool(panic::catch_unwind(f).is_err()) in must_fail()
287 /// Anything that can be tested must be capable of producing a `TestResult`
296 fn result(&self, _: &mut Gen) -> TestResult; in result() argument
300 fn result(&self, _: &mut Gen) -> TestResult { in result() argument
301 TestResult::from_bool(*self) in result()
306 fn result(&self, _: &mut Gen) -> TestResult { in result() argument
307 TestResult::passed() in result()
311 impl Testable for TestResult { implementation
312 fn result(&self, _: &mut Gen) -> TestResult { in result() argument
322 fn result(&self, g: &mut Gen) -> TestResult { in result() argument
325 Err(ref err) => TestResult::error(format!("{:?}", err)), in result()
341 fn result(&self, g: &mut Gen) -> TestResult {
346 ) -> Option<TestResult> {