diff options
author | Nadrieril | 2019-04-06 17:55:43 +0200 |
---|---|---|
committer | Nadrieril | 2019-04-06 17:57:53 +0200 |
commit | 42d0f8100462f8a17a3ba1b86664310cdb71dfdc (patch) | |
tree | 202199956ed8d7497e0bd986f22473b3e92cf8f9 /dhall/tests/dhall_type.rs | |
parent | d9b4bd8d4019ca9ab999c0c4657663604158101c (diff) |
Rename some modules
Diffstat (limited to 'dhall/tests/dhall_type.rs')
-rw-r--r-- | dhall/tests/dhall_type.rs | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/dhall/tests/dhall_type.rs b/dhall/tests/dhall_type.rs deleted file mode 100644 index ac6b5e6..0000000 --- a/dhall/tests/dhall_type.rs +++ /dev/null @@ -1,53 +0,0 @@ -#![feature(proc_macro_hygiene)] -use dhall::StaticType; -use dhall_generator::dhall_expr; - -#[test] -fn test_dhall_type() { - assert_eq!(bool::get_type(), dhall_expr!(Bool)); - assert_eq!(String::get_type(), dhall_expr!(Text)); - assert_eq!( - <(bool, Option<String>)>::get_type(), - dhall_expr!({ _1: Bool, _2: Optional Text }) - ); - - #[derive(dhall::StaticType)] - #[allow(dead_code)] - struct A { - field1: bool, - field2: Option<bool>, - } - assert_eq!( - <A as dhall::StaticType>::get_type(), - dhall_expr!({ field1: Bool, field2: Optional Bool }) - ); - - #[derive(StaticType)] - #[allow(dead_code)] - struct B<'a, T: 'a> { - field1: &'a T, - field2: Option<T>, - } - assert_eq!(<B<'static, bool>>::get_type(), A::get_type()); - - #[derive(StaticType)] - #[allow(dead_code)] - struct C<T>(T, Option<String>); - assert_eq!(<C<bool>>::get_type(), <(bool, Option<String>)>::get_type()); - - #[derive(StaticType)] - #[allow(dead_code)] - struct D(); - assert_eq!( - <C<D>>::get_type(), - dhall_expr!({ _1: {}, _2: Optional Text }) - ); - - #[derive(StaticType)] - #[allow(dead_code)] - enum E<T> { - A(T), - B(String), - }; - assert_eq!(<E<bool>>::get_type(), dhall_expr!(< A: Bool | B: Text >)); -} |