Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
24 lines
687 B
Rust
24 lines
687 B
Rust
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),
|
|
},
|
|
}
|
|
}
|