1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-26 09:10:40 -05:00
denoland-deno/std/wasi/testdata/std_fs_metadata.rs
2020-06-27 13:53:43 +02:00

26 lines
822 B
Rust

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