From d7f94114ed56953cc78f1a75bdf2e220e9b6e6f1 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 18 Aug 2019 11:23:35 -0700 Subject: [PATCH] Test unit variant key --- tests/test.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test.rs b/tests/test.rs index 3175ee2..414fe69 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -110,3 +110,24 @@ fn test_newtype_key() { let ignored = &["k.unused"]; assert_ignored::(json, ignored); } + +#[test] +fn test_unit_variant_key() { + type Test = Map; + + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Deserialize)] + enum Key { + First, + Second, + } + + let json = r#"{ + "First": { + "used": null, + "unused": null + } + }"#; + + let ignored = &["First.unused"]; + assert_ignored::(json, ignored); +}