mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-23 01:18:02 +00:00
Implemented disallow_unknown
* Added codegen for disallow_unknown * ... with new default to ignore unknown values during deserialization * Added ContainerAttrs
This commit is contained in:
@@ -7,7 +7,7 @@ use num::rational::Ratio;
|
||||
|
||||
use serde::de::{Deserializer, Visitor};
|
||||
|
||||
use token::{Token, assert_de_tokens};
|
||||
use token::{Error, Token, assert_de_tokens, assert_de_tokens_ignore};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -39,7 +39,11 @@ macro_rules! declare_test {
|
||||
#[test]
|
||||
fn $name() {
|
||||
$(
|
||||
// Test ser/de roundtripping
|
||||
assert_de_tokens(&$value, $tokens);
|
||||
|
||||
// Test that the tokens are ignorable
|
||||
assert_de_tokens_ignore($tokens);
|
||||
)+
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user