Skip to content

Commit 0a5f4ae

Browse files
committed
move test to the proper directory and test #[bench]
1 parent a0562ec commit 0a5f4ae

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/run-pass/termination-trait-in-test.rs renamed to src/test/run-pass/rfc-1937-termination-trait/termination-trait-in-test.rs

+15
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
// compile-flags: --test
1212

1313
#![feature(termination_trait)]
14+
#![feature(test)]
1415

16+
extern crate test;
1517
use std::num::ParseIntError;
18+
use test::Bencher;
1619

1720
#[test]
1821
fn is_a_num() -> Result<(), ParseIntError> {
@@ -26,3 +29,15 @@ fn not_a_num() -> Result<(), ParseIntError> {
2629
let _: u32 = "abc".parse()?;
2730
Ok(())
2831
}
32+
33+
#[bench]
34+
fn test_a_positive_bench(_: &mut Bencher) -> Result<(), ParseIntError> {
35+
Ok(())
36+
}
37+
38+
#[bench]
39+
#[should_panic]
40+
fn test_a_neg_bench(_: &mut Bencher) -> Result<(), ParseIntError> {
41+
let _: u32 = "abc".parse()?;
42+
Ok(())
43+
}

0 commit comments

Comments
 (0)