mirror of
https://github.com/serde-rs/serde.git
synced 2025-10-01 23:11:18 +00:00
Actually fully test deserializing structs
This commit is contained in:
parent
77a10caf34
commit
88631b57cb
4
json.rs
4
json.rs
@ -3000,15 +3000,15 @@ mod tests {
|
|||||||
fn test_decode_struct() {
|
fn test_decode_struct() {
|
||||||
let s = "{
|
let s = "{
|
||||||
\"inner\": [
|
\"inner\": [
|
||||||
|
{ \"a\": null, \"b\": 2, \"c\": [\"abc\", \"xyz\"] }
|
||||||
]
|
]
|
||||||
}";
|
}";
|
||||||
//{ \"a\": null, \"b\": 2, \"c\": [\"abc\", \"xyz\"] }
|
|
||||||
let v: Outer = from_iter(s.chars()).unwrap();
|
let v: Outer = from_iter(s.chars()).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
v,
|
v,
|
||||||
Outer {
|
Outer {
|
||||||
inner: vec![
|
inner: vec![
|
||||||
//Inner { a: (), b: 2, c: vec!["abc".to_strbuf(), "xyz".to_strbuf()] }
|
Inner { a: (), b: 2, c: vec!["abc".to_strbuf(), "xyz".to_strbuf()] }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user