Skip to content

Commit

Permalink
Add a test file to observe the behavior of the built-in libtest
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasKalbertodt committed Aug 13, 2022
1 parent 6914255 commit 4d4a91b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/real/mixed_bag.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#![feature(test)]

extern crate test;


#[test]
fn cat() {}

#[test]
fn dog() {
panic!("was not a good boy");
}

#[test]
#[ignore]
fn frog() {}

#[test]
#[ignore]
fn owl() {
panic!("broke neck");
}


#[bench]
fn red(b: &mut test::Bencher) {
b.iter(|| std::thread::sleep(std::time::Duration::from_millis(50)));
}

#[bench]
fn blue(_: &mut test::Bencher) {
panic!("sky fell down");
}

#[bench]
#[ignore]
fn purple(b: &mut test::Bencher) {
b.iter(|| {});
}

#[bench]
#[ignore]
fn cyan(_: &mut test::Bencher) {
panic!("not creative enough");
}

0 comments on commit 4d4a91b

Please sign in to comment.