]> git.lizzy.rs Git - rust.git/blob - src/test/ui/test-thread-capture.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / test-thread-capture.rs
1 // compile-flags: --test
2 // run-fail
3 // run-flags: --test-threads=1
4 // check-run-results
5 // exec-env:RUST_BACKTRACE=0
6 // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
7 // ignore-emscripten no threads support
8
9 #[test]
10 fn thready_pass() {
11     println!("fee");
12     std::thread::spawn(|| {
13         println!("fie");
14         println!("foe");
15     })
16     .join()
17     .unwrap();
18     println!("fum");
19 }
20
21 #[test]
22 fn thready_fail() {
23     println!("fee");
24     std::thread::spawn(|| {
25         println!("fie");
26         println!("foe");
27     })
28     .join()
29     .unwrap();
30     println!("fum");
31     panic!();
32 }