use treehouse::vfs::{entries, query, BufferedFile, Content, VPath};

fn vfs() -> BufferedFile {
    BufferedFile::new(Content::new("text/plain", b"hewwo :3".to_vec()))
}

#[test]
fn dir() {
    let vfs = vfs();
    assert!(entries(&vfs, VPath::ROOT).is_empty());
}

#[test]
fn content() {
    let vfs = vfs();
    assert_eq!(
        query::<Content>(&vfs, VPath::ROOT)
            .map(|c| c.bytes())
            .as_deref(),
        Some(b"hewwo :3".as_slice()),
    );
}
