]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
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 | |
fc512014 | 7 | // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" |
74b04a01 XL |
8 | |
9 | // ignore-wasm no panic or subprocess support | |
10 | // ignore-emscripten no panic or subprocess support | |
f9f354fc | 11 | // ignore-sgx no subprocess support |
74b04a01 XL |
12 | |
13 | #![cfg(test)] | |
14 | ||
15 | use std::io::Write; | |
16 | ||
17 | #[test] | |
18 | fn it_works() { | |
19 | println!("about to succeed"); | |
20 | assert_eq!(1 + 1, 2); | |
21 | } | |
22 | ||
23 | #[test] | |
24 | #[should_panic] | |
25 | fn it_panics() { | |
26 | println!("about to panic"); | |
27 | assert_eq!(1 + 1, 4); | |
28 | } | |
29 | ||
30 | #[test] | |
31 | fn it_fails() { | |
32 | println!("about to fail"); | |
33 | assert_eq!(1 + 1, 4); | |
34 | } | |
35 | ||
36 | #[test] | |
37 | fn it_writes_to_stdio() { | |
38 | println!("hello, world"); | |
39 | writeln!(std::io::stdout(), "testing123").unwrap(); | |
40 | writeln!(std::io::stderr(), "testing321").unwrap(); | |
41 | } |