summaryrefslogtreecommitdiff
path: root/serde_dhall/tests
diff options
context:
space:
mode:
authorNadrieril2020-11-20 22:46:22 +0000
committerGitHub2020-11-20 22:46:22 +0000
commit4e6cab79e06a999d44604f14d3d7c7c4dad4e502 (patch)
treebacc3cc0fec11daae2175e161a530c31248e71fa /serde_dhall/tests
parentfe9b732d61cfa347fc220887ca27a8439745c82a (diff)
parent0415bc0ce299dfc707b7f8dc2ee26ceb57bce84e (diff)
Merge pull request #201 from Nadrieril/parse-binary
Expose binary parsing in the API
Diffstat (limited to '')
-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
}