mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 18:21:01 +00:00
Panic by default in serde_test is_human_readable
The serde_test Serializer and Deserializer panic in is_human_readable unless the readableness has been set explicitly through one of the hidden functions. This is to force types that have distinct readable/compact representations to be tested explicitly in one or the other, rather than with a plain assert_tokens which arbitrarily picks one. We need to follow up by designing a better API in serde_test to expose this publicly. For now serde_test cannot be used to test types that rely on is_human_readable. (The hidden functions are meant for our test suite only.)
This commit is contained in:
@@ -19,7 +19,7 @@ fn ip_addr_roundtrip() {
|
||||
seq b"1234".iter().map(|&b| Token::U8(b)),
|
||||
Token::TupleEnd,
|
||||
],
|
||||
false,
|
||||
Some(false),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,6 @@ fn socked_addr_roundtrip() {
|
||||
Token::U16(1234),
|
||||
Token::TupleEnd,
|
||||
],
|
||||
false,
|
||||
Some(false),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user