diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/maybe.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/maybe.rs b/tests/maybe.rs index 1437195..702f0c5 100644 --- a/tests/maybe.rs +++ b/tests/maybe.rs @@ -47,3 +47,14 @@ fn test_not_t_in_struct() { let json = "{\"bar\": []}"; assert!(from_str::<Foo>(json).unwrap().bar.is_not()); } + +#[test] +fn test_shallow() { + #[derive(Deserialize)] + struct Foo { + #[serde(rename = "bar")] + _bar: f64, + } + let json = "{\"bar\": []}"; + assert!(from_str::<MayBe<Foo>>(json).is_err()); +} |