Fix tests.

This commit is contained in:
Tom Alexander 2023-10-12 16:14:23 -04:00
parent 8654cf5507
commit 5136880532
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -584,8 +584,8 @@ mod tests {
let global_settings = GlobalSettings::default(); let global_settings = GlobalSettings::default();
let initial_context = ContextElement::document_context(); let initial_context = ContextElement::document_context();
let initial_context = Context::new(&global_settings, List::new(&initial_context)); let initial_context = Context::new(&global_settings, List::new(&initial_context));
let plain_list_matcher = parser_with_context!(plain_list)(&initial_context); let (remaining, result) =
let (remaining, result) = plain_list_matcher(input).unwrap(); plain_list(std::iter::empty(), input, &initial_context, input).unwrap();
assert_eq!(Into::<&str>::into(remaining), ""); assert_eq!(Into::<&str>::into(remaining), "");
assert_eq!(result.get_standard_properties().get_source(), "1."); assert_eq!(result.get_standard_properties().get_source(), "1.");
} }
@ -596,8 +596,8 @@ mod tests {
let global_settings = GlobalSettings::default(); let global_settings = GlobalSettings::default();
let initial_context = ContextElement::document_context(); let initial_context = ContextElement::document_context();
let initial_context = Context::new(&global_settings, List::new(&initial_context)); let initial_context = Context::new(&global_settings, List::new(&initial_context));
let plain_list_matcher = parser_with_context!(plain_list)(&initial_context); let (remaining, result) =
let (remaining, result) = plain_list_matcher(input).unwrap(); plain_list(std::iter::empty(), input, &initial_context, input).unwrap();
assert_eq!(Into::<&str>::into(remaining), ""); assert_eq!(Into::<&str>::into(remaining), "");
assert_eq!(result.get_standard_properties().get_source(), "1. foo"); assert_eq!(result.get_standard_properties().get_source(), "1. foo");
} }
@ -609,8 +609,7 @@ mod tests {
let global_settings = GlobalSettings::default(); let global_settings = GlobalSettings::default();
let initial_context = ContextElement::document_context(); let initial_context = ContextElement::document_context();
let initial_context = Context::new(&global_settings, List::new(&initial_context)); let initial_context = Context::new(&global_settings, List::new(&initial_context));
let plain_list_matcher = parser_with_context!(plain_list)(&initial_context); let result = plain_list(std::iter::empty(), input, &initial_context, input);
let result = plain_list_matcher(input);
assert!(result.is_err()); assert!(result.is_err());
} }
@ -621,8 +620,7 @@ mod tests {
let global_settings = GlobalSettings::default(); let global_settings = GlobalSettings::default();
let initial_context = ContextElement::document_context(); let initial_context = ContextElement::document_context();
let initial_context = Context::new(&global_settings, List::new(&initial_context)); let initial_context = Context::new(&global_settings, List::new(&initial_context));
let plain_list_matcher = parser_with_context!(plain_list)(&initial_context); let result = plain_list(std::iter::empty(), input, &initial_context, input);
let result = plain_list_matcher(input);
assert!(result.is_ok()); assert!(result.is_ok());
} }