summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/maybe.rs11
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());
+}