Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
20
vendor/tokio/tests/fs.rs
vendored
Normal file
20
vendor/tokio/tests/fs.rs
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#![warn(rust_2018_idioms)]
|
||||
#![cfg(all(feature = "full", not(tokio_wasi)))] // Wasi does not support file operations
|
||||
|
||||
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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue