Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 553adb4

Browse files
authored
Merge pull request toby#27 from madadam/master
Add test for ser/de of struct with vec of tuples (issue #17)
2 parents dd11481 + 403f043 commit 553adb4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/tests.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,18 @@ fn ser_de_flattened_adjacently_tagged_enum() {
429429
fn ser_de_vec_of_tuples() {
430430
test_ser_de_eq(vec![(1, 2), (3, 4)]);
431431
}
432+
433+
// https://github.com/toby/serde-bencode/issues/17
434+
#[test]
435+
fn ser_de_field_vec_tuple() {
436+
#[derive(Deserialize, Serialize, Eq, PartialEq, Debug)]
437+
struct Foo {
438+
bar: Vec<(u16,)>,
439+
}
440+
441+
let foo = Foo {
442+
bar: vec![(1,), (3,)],
443+
};
444+
445+
test_ser_de_eq(foo);
446+
}

0 commit comments

Comments
 (0)