move test to the proper directory and test #[bench]
This commit is contained in:
parent
a0562ec369
commit
0a5f4aebb1
1 changed files with 15 additions and 0 deletions
|
|
@ -11,8 +11,11 @@
|
|||
// compile-flags: --test
|
||||
|
||||
#![feature(termination_trait)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
use std::num::ParseIntError;
|
||||
use test::Bencher;
|
||||
|
||||
#[test]
|
||||
fn is_a_num() -> Result<(), ParseIntError> {
|
||||
|
|
@ -26,3 +29,15 @@ fn not_a_num() -> Result<(), ParseIntError> {
|
|||
let _: u32 = "abc".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(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue