use crate::Dir;
use std::path::Path;
#[test]
fn hello_test() -> std::io::Result<()> {
let cwd = Dir("my/root");
let path = Path::new("path/to/file.txt");
cwd.create_parents(path)?;
cwd.write(path, "Hello, world!\n")?;
assert!(!path.exists());
assert!(cwd.exists(path));
assert!(Path::new("my/root/path/to/file.txt").exists());
assert_eq!(cwd.read_to_string(path)?, "Hello, world!\n");
let other_cwd = Dir("some/other/root");
cwd.move_to(&other_cwd, path)?;
assert!(!cwd.exists(path));
assert!(other_cwd.exists(path));
Ok(())
}