Skip to content

Commit

Permalink
Merge pull request #27 from madadam/master
Browse files Browse the repository at this point in the history
Add test for ser/de of struct with vec of tuples (issue #17)
  • Loading branch information
madadam authored Nov 11, 2021
2 parents dd11481 + 403f043 commit 553adb4
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 553adb4

Please sign in to comment.