From 5810fb796103ff21403ca67ba9352ea877371218 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 13 Sep 2017 22:49:45 -0700 Subject: [PATCH] type alias test --- src/schala_lang/parsing.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schala_lang/parsing.rs b/src/schala_lang/parsing.rs index e296c45..36d52a1 100644 --- a/src/schala_lang/parsing.rs +++ b/src/schala_lang/parsing.rs @@ -654,6 +654,7 @@ mod parse_tests { macro_rules! parse_test { ($string:expr, $correct:expr) => { assert_eq!(parse(tokenize($string)).unwrap(), $correct) } } + macro_rules! binexp { ($op:expr, $lhs:expr, $rhs:expr) => { BinExp($op, Box::new($lhs), Box::new($rhs)) } } @@ -708,5 +709,6 @@ mod parse_tests { #[test] fn parsing_types() { parse_test!("type Yolo = Yolo", AST(vec![Declaration(TypeDecl(rc!(Yolo), TypeBody(vec![Variant::Singleton(rc!(Yolo))])))])); + parse_test!("alias Sex = Drugs", AST(vec![Declaration(TypeAlias(rc!(Sex), rc!(Drugs)))])); } }