1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -05:00
denoland-deno/std/wasi/testdata/std_fs_file_metadata.rs

24 lines
771 B
Rust
Raw Normal View History

// { "preopens": { "/fixture": "fixture" } }
fn main() {
let file = std::fs::File::open("/fixture/file").unwrap();
let metadata = file.metadata().unwrap();
assert!(metadata.is_file());
assert!(metadata.len() == 5);
let file = std::fs::File::open("/fixture/symlink_to_file").unwrap();
let metadata = file.metadata().unwrap();
assert!(metadata.is_file());
assert!(metadata.len() == 5);
let file = std::fs::File::open("/fixture/directory/file").unwrap();
let metadata = file.metadata().unwrap();
assert!(metadata.is_file());
assert!(metadata.len() == 15);
let file = std::fs::File::open("/fixture/directory/symlink_to_file").unwrap();
let metadata = file.metadata().unwrap();
assert!(metadata.is_file());
assert!(metadata.len() == 15);
}