summaryrefslogtreecommitdiff
path: root/dhall/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dhall/tests/traits.rs24
1 files changed, 16 insertions, 8 deletions
diff --git a/dhall/tests/traits.rs b/dhall/tests/traits.rs
index 00e6509..a7cd530 100644
--- a/dhall/tests/traits.rs
+++ b/dhall/tests/traits.rs
@@ -1,7 +1,7 @@
#![feature(proc_macro_hygiene)]
use dhall::de::SimpleStaticType;
use dhall_core::{SubExpr, X};
-use dhall_generator::dhall_expr;
+use dhall_generator;
#[test]
fn test_static_type() {
@@ -9,15 +9,21 @@ fn test_static_type() {
x.into()
}
- assert_eq!(bool::get_simple_static_type(), mktype(dhall_expr!(Bool)));
- assert_eq!(String::get_simple_static_type(), mktype(dhall_expr!(Text)));
+ assert_eq!(
+ bool::get_simple_static_type(),
+ mktype(dhall_generator::subexpr!(Bool))
+ );
+ assert_eq!(
+ String::get_simple_static_type(),
+ mktype(dhall_generator::subexpr!(Text))
+ );
assert_eq!(
<Option<bool>>::get_simple_static_type(),
- mktype(dhall_expr!(Optional Bool))
+ mktype(dhall_generator::subexpr!(Optional Bool))
);
assert_eq!(
<(bool, Option<String>)>::get_simple_static_type(),
- mktype(dhall_expr!({ _1: Bool, _2: Optional Text }))
+ mktype(dhall_generator::subexpr!({ _1: Bool, _2: Optional Text }))
);
#[derive(dhall::de::SimpleStaticType)]
@@ -28,7 +34,9 @@ fn test_static_type() {
}
assert_eq!(
<A as dhall::de::SimpleStaticType>::get_simple_static_type(),
- mktype(dhall_expr!({ field1: Bool, field2: Optional Bool }))
+ mktype(
+ dhall_generator::subexpr!({ field1: Bool, field2: Optional Bool })
+ )
);
#[derive(SimpleStaticType)]
@@ -55,7 +63,7 @@ fn test_static_type() {
struct D();
assert_eq!(
<C<D>>::get_simple_static_type(),
- mktype(dhall_expr!({ _1: {}, _2: Optional Text }))
+ mktype(dhall_generator::subexpr!({ _1: {}, _2: Optional Text }))
);
#[derive(SimpleStaticType)]
@@ -66,6 +74,6 @@ fn test_static_type() {
};
assert_eq!(
<E<bool>>::get_simple_static_type(),
- mktype(dhall_expr!(< A: Bool | B: Text >))
+ mktype(dhall_generator::subexpr!(< A: Bool | B: Text >))
);
}