summaryrefslogtreecommitdiff
path: root/serde_dhall/tests
diff options
context:
space:
mode:
authorNadrieril2020-11-20 21:35:58 +0000
committerNadrieril2020-11-20 21:36:34 +0000
commit0415bc0ce299dfc707b7f8dc2ee26ceb57bce84e (patch)
treebacc3cc0fec11daae2175e161a530c31248e71fa /serde_dhall/tests
parentfe9b732d61cfa347fc220887ca27a8439745c82a (diff)
Expose binary parsing in the API
Diffstat (limited to 'serde_dhall/tests')
-rw-r--r--serde_dhall/tests/serde.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/serde_dhall/tests/serde.rs b/serde_dhall/tests/serde.rs
index 4c184e7..1181f72 100644
--- a/serde_dhall/tests/serde.rs
+++ b/serde_dhall/tests/serde.rs
@@ -205,6 +205,27 @@ mod serde {
assert!(from_str("List/length [True, 42]").parse::<bool>().is_err());
}
+ #[test]
+ fn test_file() {
+ assert_eq!(
+ serde_dhall::from_file(
+ "../dhall-lang/tests/parser/success/unit/BoolLitTrueA.dhall"
+ )
+ .static_type_annotation()
+ .parse::<bool>()
+ .map_err(|e| e.to_string()),
+ Ok(true)
+ );
+ assert_eq!(
+ serde_dhall::from_binary_file(
+ "../dhall-lang/tests/parser/success/unit/BoolLitTrueB.dhallb"
+ )
+ .static_type_annotation()
+ .parse::<bool>()
+ .map_err(|e| e.to_string()),
+ Ok(true)
+ );
+ }
// TODO: test various builder configurations
// In particular test cloning and reusing builder
}