Skip to content

Commit

Permalink
Add test for ser/de of struct with vec of tuples (issue toby#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
madadam committed Nov 11, 2021
1 parent 4faf05f commit 403f043
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,18 @@ fn ser_de_flattened_adjacently_tagged_enum() {
fn ser_de_vec_of_tuples() {
test_ser_de_eq(vec![(1, 2), (3, 4)]);
}

// https://github.com/toby/serde-bencode/issues/17
#[test]
fn ser_de_field_vec_tuple() {
#[derive(Deserialize, Serialize, Eq, PartialEq, Debug)]
struct Foo {
bar: Vec<(u16,)>,
}

let foo = Foo {
bar: vec![(1,), (3,)],
};

test_ser_de_eq(foo);
}

0 comments on commit 403f043

Please sign in to comment.