Remove PartialEq from Object.
This commit is contained in:
@@ -210,12 +210,12 @@ mod tests {
|
||||
use crate::context::GlobalSettings;
|
||||
use crate::context::List;
|
||||
use crate::parser::element_parser::element;
|
||||
use crate::types::CitationReference;
|
||||
use crate::types::Element;
|
||||
use crate::types::GetStandardProperties;
|
||||
use crate::types::StandardProperties;
|
||||
|
||||
#[test]
|
||||
fn citation_simple() {
|
||||
fn citation_simple() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let input = OrgSource::new("[cite:@foo]");
|
||||
let global_settings = GlobalSettings::default();
|
||||
let initial_context = ContextElement::document_context();
|
||||
@@ -232,23 +232,31 @@ mod tests {
|
||||
"[cite:@foo]"
|
||||
);
|
||||
assert_eq!(first_paragraph.children.len(), 1);
|
||||
assert_eq!(
|
||||
first_paragraph
|
||||
.children
|
||||
.first()
|
||||
.expect("Len already asserted to be 1"),
|
||||
&Object::Citation(Citation {
|
||||
source: "[cite:@foo]",
|
||||
style: None,
|
||||
prefix: vec![],
|
||||
suffix: vec![],
|
||||
children: vec![CitationReference {
|
||||
source: "@foo",
|
||||
key: "foo",
|
||||
prefix: vec![],
|
||||
suffix: vec![]
|
||||
}]
|
||||
})
|
||||
);
|
||||
|
||||
match first_paragraph
|
||||
.children
|
||||
.first()
|
||||
.expect("Len already asserted to be 1.")
|
||||
{
|
||||
Object::Citation(inner) => {
|
||||
assert_eq!(inner.get_source(), "[cite:@foo]");
|
||||
assert_eq!(inner.children.len(), 1);
|
||||
assert!(inner.prefix.is_empty());
|
||||
assert!(inner.suffix.is_empty());
|
||||
assert!(inner.style.is_none());
|
||||
let citation_reference = inner
|
||||
.children
|
||||
.first()
|
||||
.expect("Len already asserted to be 1.");
|
||||
assert_eq!(citation_reference.get_source(), "@foo");
|
||||
assert_eq!(citation_reference.key, "foo");
|
||||
assert!(citation_reference.prefix.is_empty());
|
||||
assert!(citation_reference.suffix.is_empty());
|
||||
}
|
||||
_ => {
|
||||
return Err("Child should be a citation.".into());
|
||||
}
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user