Elie Kheirallah | e2bd850 | 2023-03-20 21:19:27 +0000 | [diff] [blame] | 1 | use libtest_mimic::{Trial, Arguments}; |
2 | |||||
3 | |||||
4 | #[test] | ||||
5 | fn check_test_on_main_thread() { | ||||
6 | let outer_thread = std::thread::current().id(); | ||||
7 | |||||
8 | let mut args = Arguments::default(); | ||||
9 | args.test_threads = Some(1); | ||||
10 | let conclusion = libtest_mimic::run(&args, vec![Trial::test("check", move || { | ||||
11 | assert_eq!(outer_thread, std::thread::current().id()); | ||||
12 | Ok(()) | ||||
13 | })]); | ||||
14 | |||||
15 | assert_eq!(conclusion.num_passed, 1); | ||||
16 | } |