Add first internal-linking test
This commit is contained in:
parent
924692d7cb
commit
d27c8ced34
1 changed files with 24 additions and 0 deletions
|
@ -249,3 +249,27 @@ fn process_rw_result(links: StoreResult<Option<Value>>) -> Result<LinkIter> {
|
||||||
Ok(LinkIter::new(links))
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue