From 46cb68809cdda92114adb2593b13a43687306786 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 5 Apr 2020 11:38:10 +0100 Subject: Add a test --- serde_dhall/tests/de.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'serde_dhall/tests') 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, + } + // Omit optional field + assert_eq!(parse::("{ x = 1 }"), Foo { x: 1, y: None }); + // https://github.com/Nadrieril/dhall-rust/issues/155 assert!(from_str::("List/length [True, 42]").is_err()); } -- cgit v1.2.3