diff options
author | Nadrieril | 2020-04-05 11:38:10 +0100 |
---|---|---|
committer | Nadrieril | 2020-04-05 11:38:10 +0100 |
commit | 46cb68809cdda92114adb2593b13a43687306786 (patch) | |
tree | 60f32e7d11cff58ed6794a1fc52e37e999adf1a3 /serde_dhall/tests | |
parent | 060c835db9638556763b98cfcf7c4be196653644 (diff) |
Add a test
Diffstat (limited to 'serde_dhall/tests')
-rw-r--r-- | serde_dhall/tests/de.rs | 8 |
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()); } |