Updated error to be more expressive.
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:
@@ -1,8 +1,11 @@
|
||||
mod support;
|
||||
|
||||
use morethantext::{action::*, ErrorID, Include, MoreThanText, Name, Path, TestMoreThanText};
|
||||
use std::{
|
||||
sync::mpsc::{channel, RecvTimeoutError},
|
||||
time::Duration,
|
||||
};
|
||||
use support::random_name;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub static TIMEOUT: Duration = Duration::from_millis(500);
|
||||
@@ -14,7 +17,7 @@ fn are_errors_produced_for_duplicate_names() {
|
||||
mtt.create_document(docdef.clone()).unwrap();
|
||||
match mtt.create_document(docdef) {
|
||||
Ok(_) => assert!(false, "should have failed"),
|
||||
Err(err) => match err.error_id() {
|
||||
Err(err) => match err.get_error_ids().back().unwrap() {
|
||||
ErrorID::NameAlreadyExists => {}
|
||||
_ => unreachable!("got {:?}, should be name already exists", err),
|
||||
},
|
||||
@@ -24,7 +27,7 @@ fn are_errors_produced_for_duplicate_names() {
|
||||
#[test]
|
||||
fn does_document_respond_to() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let doc_name = TestMoreThanText::random_name();
|
||||
let doc_name = random_name();
|
||||
let mut requests: Vec<UserAction> = Vec::new();
|
||||
requests.push(Addition::new(doc_name.clone()).into());
|
||||
requests.push(Delete::new(doc_name.clone()).into());
|
||||
|
||||
Reference in New Issue
Block a user