-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Labels
arraysIssues related to mapping XML content onto arrays using serdeIssues related to mapping XML content onto arrays using serdebugserdeIssues related to mapping from Rust types to XMLIssues related to mapping from Rust types to XML
Description
The following test is failed on second assert_eq! (cargo test --all-features -- issue500):
#[test]
fn issue500() {
#[derive(Debug, Deserialize, Serialize, PartialEq)]
struct TagOne {}
#[derive(Debug, Deserialize, Serialize, PartialEq)]
struct TagTwo {}
#[derive(Debug, Deserialize, Serialize, PartialEq)]
enum Tag {
TagOne(TagOne),
TagTwo(TagTwo),
}
#[derive(Debug, Deserialize, Serialize, PartialEq)]
struct Root {
#[serde(rename = "$value", default)]
data: Vec<Tag>,
}
let data: Root = from_str("\
<root>\
<TagOne></TagOne>\
<TagTwo></TagTwo>\
<TagOne></TagOne>\
</root>\
").unwrap();
assert_eq!(
data,
Root {
data: vec![
Tag::TagOne(TagOne {}),
Tag::TagTwo(TagTwo {}),
Tag::TagOne(TagOne {}),
],
}
);
let data: Vec<Tag> = from_str("\
<TagOne></TagOne>\
<TagTwo></TagTwo>\
<TagOne></TagOne>\
").unwrap();
assert_eq!(
data,
vec![
Tag::TagOne(TagOne {}),
Tag::TagTwo(TagTwo {}),
Tag::TagOne(TagOne {}),
]
);
}Output:
---- issue500 stdout ----
thread 'issue500' panicked at 'assertion failed: `(left == right)`
Diff < left / right > :
[
TagOne(
TagOne,
),
> TagTwo(
> TagTwo,
> ),
TagOne(
TagOne,
),
]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arraysIssues related to mapping XML content onto arrays using serdeIssues related to mapping XML content onto arrays using serdebugserdeIssues related to mapping from Rust types to XMLIssues related to mapping from Rust types to XML