1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00

test(std/wasi): add create directory and file tests (#6603)

This commit is contained in:
Casper Beyer 2020-07-02 21:15:02 +08:00 committed by GitHub
parent 851344f2ed
commit cc2dda6754
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,6 @@
// { "preopens": { "/scratch": "scratch" } }
fn main() {
assert!(std::fs::create_dir("/scratch/directory").is_ok());
assert!(std::fs::metadata("/scratch/directory").unwrap().is_dir());
}

View file

@ -0,0 +1,6 @@
// { "preopens": { "/scratch": "scratch" } }
fn main() {
assert!(std::fs::File::create("/scratch/file").is_ok());
assert!(std::fs::metadata("/scratch/file").unwrap().is_file());
}