notesmachine/server/nm-store/src/lib.rs

24 lines
529 B
Rust
Raw Normal View History

mod errors;
mod store;
mod structs;
pub use crate::store::NoteStore;
pub use crate::errors::NoteStoreError;
#[cfg(test)]
mod tests {
use super::*;
use tokio;
#[tokio::test(threaded_scheduler)]
async fn it_works() {
let storagepool = NoteStore::new("sqlite://:memory:").await;
assert!(storagepool.is_ok());
let storagepool = storagepool.unwrap();
assert!(storagepool.reset_database().await.is_ok());
let unfoundpage = storagepool.fetch_page("nonexistent-page").await;
assert!(unfoundpage.is_err());
}
}