mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 19:28:01 +00:00
Add test for all variants skipped
This commit is contained in:
@@ -64,6 +64,13 @@ enum Enum {
|
||||
Map { a: i32, b: i32, c: i32 },
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug, Deserialize)]
|
||||
enum EnumSkipAll {
|
||||
#[allow(dead_code)]
|
||||
#[serde(skip_deserializing)]
|
||||
Skipped,
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
macro_rules! declare_test {
|
||||
@@ -872,6 +879,12 @@ declare_error_tests! {
|
||||
],
|
||||
Error::UnknownVariant("Skipped".to_owned()),
|
||||
}
|
||||
test_enum_skip_all<EnumSkipAll> {
|
||||
&[
|
||||
Token::EnumUnit("EnumSkipAll", "Skipped"),
|
||||
],
|
||||
Error::UnknownVariant("Skipped".to_owned()),
|
||||
}
|
||||
test_struct_seq_too_long<Struct> {
|
||||
&[
|
||||
Token::SeqStart(Some(4)),
|
||||
|
||||
Reference in New Issue
Block a user