You can not 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
420 B
21 lines
420 B
#![warn(rust_2018_idioms)]
|
|
#![cfg(feature = "full")]
|
|
|
|
use tokio::fs;
|
|
use tokio_test::assert_ok;
|
|
|
|
#[tokio::test]
|
|
async fn path_read_write() {
|
|
let temp = tempdir();
|
|
let dir = temp.path();
|
|
|
|
assert_ok!(fs::write(dir.join("bar"), b"bytes").await);
|
|
let out = assert_ok!(fs::read(dir.join("bar")).await);
|
|
|
|
assert_eq!(out, b"bytes");
|
|
}
|
|
|
|
fn tempdir() -> tempfile::TempDir {
|
|
tempfile::tempdir().unwrap()
|
|
}
|