summaryrefslogtreecommitdiff
path: root/serde_dhall/tests
diff options
context:
space:
mode:
Diffstat (limited to 'serde_dhall/tests')
-rw-r--r--serde_dhall/tests/de.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/serde_dhall/tests/de.rs b/serde_dhall/tests/de.rs
index f28b265..653613a 100644
--- a/serde_dhall/tests/de.rs
+++ b/serde_dhall/tests/de.rs
@@ -85,6 +85,14 @@ fn test_de_untyped() {
expected_map
);
+ #[derive(Debug, PartialEq, Eq, Deserialize)]
+ struct Foo {
+ x: u64,
+ y: Option<u64>,
+ }
+ // Omit optional field
+ assert_eq!(parse::<Foo>("{ x = 1 }"), Foo { x: 1, y: None });
+
// https://github.com/Nadrieril/dhall-rust/issues/155
assert!(from_str::<bool>("List/length [True, 42]").is_err());
}