Got 404 working again.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
23
tests/lib_document_test.rs
Normal file
23
tests/lib_document_test.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use morethantext::{MTTError, MoreThanText};
|
||||
|
||||
#[test]
|
||||
fn get_home_page() {
|
||||
let mtt = MoreThanText::new();
|
||||
match mtt.get_document("page", "home") {
|
||||
Ok(_) => {}
|
||||
Err(err) => assert!(false, "got error {:?}", err),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn errors_on_missing_page() {
|
||||
let mtt = MoreThanText::new();
|
||||
let doc_name = "missing";
|
||||
match mtt.get_document(doc_name, "home") {
|
||||
Ok(data) => assert!(false, "got '{}', should have been not found error", data),
|
||||
Err(err) => match err {
|
||||
MTTError::DocumentNotFound(result) => assert_eq!(result, doc_name),
|
||||
_ => unreachable!("got {:?}, should have been not found", err),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user