]> git.lizzy.rs Git - rust.git/blob - src/test/ui/test-panic-abort-nocapture.rs
Auto merge of #68827 - ssomers:btree_navigation_revisited, r=Mark-Simulacrum
[rust.git] / src / test / ui / test-panic-abort-nocapture.rs
1 // no-prefer-dynamic
2 // compile-flags: --test -Cpanic=abort -Zpanic_abort_tests
3 // run-flags: --test-threads=1 --nocapture
4 // run-fail
5 // check-run-results
6 // exec-env:RUST_BACKTRACE=0
7
8 // ignore-wasm no panic or subprocess support
9 // ignore-emscripten no panic or subprocess support
10
11 #![cfg(test)]
12
13 use std::io::Write;
14
15 #[test]
16 fn it_works() {
17     println!("about to succeed");
18     assert_eq!(1 + 1, 2);
19 }
20
21 #[test]
22 #[should_panic]
23 fn it_panics() {
24     println!("about to panic");
25     assert_eq!(1 + 1, 4);
26 }
27
28 #[test]
29 fn it_fails() {
30     println!("about to fail");
31     assert_eq!(1 + 1, 4);
32 }
33
34 #[test]
35 fn it_writes_to_stdio() {
36     println!("hello, world");
37     writeln!(std::io::stdout(), "testing123").unwrap();
38     writeln!(std::io::stderr(), "testing321").unwrap();
39 }