Add ser tests for normal HashMap

This commit is contained in:
David Tolnay 2016-06-11 09:42:02 -07:00
parent dd3f653103
commit 322d7a90db
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -208,15 +208,22 @@ declare_ser_tests! {
],
}
test_hashmap {
hashmap![FnvHasher @ 1 => 2, 3 => 4] => &[
Token::MapStart(Some(2)),
HashMap::<isize, isize>::new() => &[
Token::MapStart(Some(0)),
Token::MapEnd,
],
hashmap![1 => 2] => &[
Token::MapStart(Some(1)),
Token::MapSep,
Token::I32(1),
Token::I32(2),
Token::MapEnd,
],
hashmap![FnvHasher @ 1 => 2] => &[
Token::MapStart(Some(1)),
Token::MapSep,
Token::I32(3),
Token::I32(4),
Token::I32(1),
Token::I32(2),
Token::MapEnd,
],
}