Add first internal-linking test

This commit is contained in:
Matthias Beyer 2016-10-15 10:33:30 +02:00
parent 924692d7cb
commit d27c8ced34

View file

@ -249,3 +249,27 @@ fn process_rw_result(links: StoreResult<Option<Value>>) -> Result<LinkIter> {
Ok(LinkIter::new(links))
}
#[cfg(test)]
mod test {
use std::path::PathBuf;
use libimagstore::store::Store;
use super::InternalLinker;
pub fn get_store() -> Store {
Store::new(PathBuf::from("/"), None).unwrap()
}
#[test]
fn test_new_entry_no_links() {
let store = get_store();
let entry = store.create(PathBuf::from("test_new_entry_no_links")).unwrap();
let links = entry.get_internal_links();
assert!(links.is_ok());
let links = links.unwrap();
assert_eq!(links.collect::<Vec<_>>().len(), 0);
}
}