remove treehouse-format crate and collapse everything into src
This commit is contained in:
parent
ca127a9411
commit
b792688776
66 changed files with 145 additions and 112 deletions
22
tests/it/vfs/physical.rs
Normal file
22
tests/it/vfs/physical.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
use std::path::Path;
|
||||
|
||||
use treehouse::vfs::{entries, query, Content, PhysicalDir, VPath, VPathBuf};
|
||||
|
||||
fn vfs() -> PhysicalDir {
|
||||
let root = Path::new("tests/it/vfs_physical").to_path_buf();
|
||||
PhysicalDir::new(root)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dir() {
|
||||
let vfs = vfs();
|
||||
let dir = entries(&vfs, VPath::ROOT);
|
||||
assert_eq!(&dir[..], &[VPathBuf::new("test.txt")]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn content() {
|
||||
let vfs = vfs();
|
||||
let content = query::<Content>(&vfs, VPath::new("test.txt")).map(Content::bytes);
|
||||
assert_eq!(content.as_deref(), Some(b"hewwo :3\n".as_slice()));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue