Mercurial > lbo > hg > time_test
view example/src/example.rs @ 6:39057a44d852 default tip
Added tag v0.2.2 for changeset 0138438fae34
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sat, 12 Oct 2019 13:21:23 +0200 |
parents | c21d8b7b61cb |
children |
line wrap: on
line source
#[cfg(test)] mod tests { #[test] fn my_test() { time_test!(); assert!(true); assert_eq!(1, 1); } #[test] fn my_test_with_initialization() { // Do possibly expensive preparation before. let a = 1; let b = 2; time_test!(); assert!(true); assert_eq!(1, 1); } #[test] fn my_test_with_multiple_timers() { time_test!(); { time_test!("all"); { // sub-test 1 time_test!("sub1"); assert_eq!(1, 1); } { // sub-test 2 time_test!("sub2"); assert!(true); } } // The order of timers will be sub1, sub2, all, <unnamed>. } }