1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-23 15:16:54 -05:00
denoland-deno/std/wasi/testdata/std_fs_file_metadata.rs
2020-06-29 09:34:18 -04:00

23 lines
771 B
Rust

// { "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);
}