rust/tests/ui/rfc-1937-termination-trait/termination-trait-in-test.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
476 B
Rust
Raw Normal View History

// compile-flags: --test
// run-pass
// needs-unwind
#![feature(test)]
extern crate test;
use std::num::ParseIntError;
use test::Bencher;
#[test]
fn is_a_num() -> Result<(), ParseIntError> {
let _: u32 = "22".parse()?;
Ok(())
}
#[bench]
fn test_a_positive_bench(_: &mut Bencher) -> Result<(), ParseIntError> {
Ok(())
}
#[bench]
#[should_panic]
fn test_a_neg_bench(_: &mut Bencher) -> Result<(), ParseIntError> {
let _: u32 = "abc".parse()?;
Ok(())
}