summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--serde_dhall/tests/de.rs8
-rw-r--r--test.dhall5
-rw-r--r--tests_buffer1
3 files changed, 10 insertions, 4 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());
}
diff --git a/test.dhall b/test.dhall
index 641c219..c91ac54 100644
--- a/test.dhall
+++ b/test.dhall
@@ -1,4 +1 @@
-let Prelude =
- https://prelude.dhall-lang.org/package.dhall sha256:c1b3fc613aabfb64a9e17f6c0d70fe82016a030beedd79851730993e9083fde2
-
-in Prelude
+{ x = 0 } with x = (1 + 1)
diff --git a/tests_buffer b/tests_buffer
index d07ddbd..6f5aae5 100644
--- a/tests_buffer
+++ b/tests_buffer
@@ -11,6 +11,7 @@ From https://github.com/dhall-lang/dhall-lang/issues/280 :
"${ not_really_an_expression ;-) }"
''${ not_an_expression ;-) }''
{- {- -} 1
+{ x = 0 } with x = 1 + 1
import:
failure/