You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
676 B
Rust
21 lines
676 B
Rust
5 years ago
|
#[cfg(feature = "verbose-errors")]
|
||
|
mod verbose_tests {
|
||
|
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)
|
||
|
),
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|