...
This commit is contained in:
@@ -1,14 +1,41 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
//! DocTree is a library for managing collections of markdown documents.
|
||||
//!
|
||||
//! It provides functionality for scanning directories, managing collections,
|
||||
//! and processing includes between documents.
|
||||
|
||||
// Import lazy_static
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
mod error;
|
||||
mod storage;
|
||||
mod utils;
|
||||
mod collection;
|
||||
mod doctree;
|
||||
mod include;
|
||||
|
||||
pub use error::{DocTreeError, Result};
|
||||
pub use storage::RedisStorage;
|
||||
pub use collection::{Collection, CollectionBuilder};
|
||||
pub use doctree::{DocTree, DocTreeBuilder, new};
|
||||
pub use include::process_includes;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::path::Path;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
fn test_doctree_builder() {
|
||||
// Create a storage instance
|
||||
let storage = RedisStorage::new("dummy_url").unwrap();
|
||||
|
||||
let doctree = DocTree::builder()
|
||||
.with_storage(storage)
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(doctree.collections.len(), 0);
|
||||
assert_eq!(doctree.default_collection, None);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user