2020-09-29 00:33:43 +00:00
|
|
|
mod errors;
|
|
|
|
mod store;
|
|
|
|
mod structs;
|
|
|
|
|
|
|
|
pub use crate::store::NoteStore;
|
|
|
|
pub use crate::errors::NoteStoreError;
|
|
|
|
|
|
|
|
|
2020-09-27 12:35:37 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
2020-09-29 00:33:43 +00:00
|
|
|
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());
|
2020-09-27 12:35:37 +00:00
|
|
|
}
|
|
|
|
}
|