mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
move test to the proper directory and test #[bench]
This commit is contained in:
+15
@@ -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(())
|
||||
}
|
||||
Reference in New Issue
Block a user