2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 10:49:55 +00:00
async-std/tests/verbose_errors.rs
2019-11-19 13:15:48 +01:00

16 lines
543 B
Rust

use async_std::{fs, task};
#[test]
fn open_file() {
task::block_on(async {
let non_existing_file = "/ashjudlkahasdasdsikdhajik/asdasdasdasdasdasd/fjuiklashdbflasas";
let res = fs::File::open(non_existing_file).await;
match res {
Ok(_) => panic!("Found file with random name: We live in a simulation"),
Err(e) => assert_eq!(
"Could not open /ashjudlkahasdasdsikdhajik/asdasdasdasdasdasd/fjuiklashdbflasas",
&format!("{}", e)
),
}
})
}