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:
parent
851344f2ed
commit
cc2dda6754
2 changed files with 12 additions and 0 deletions
6
std/wasi/testdata/std_fs_create_dir.rs
vendored
Normal file
6
std/wasi/testdata/std_fs_create_dir.rs
vendored
Normal 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());
|
||||||
|
}
|
6
std/wasi/testdata/std_fs_file_create.rs
vendored
Normal file
6
std/wasi/testdata/std_fs_file_create.rs
vendored
Normal 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());
|
||||||
|
}
|
Loading…
Reference in a new issue