test for function parsing

This commit is contained in:
greg 2017-09-13 23:37:49 -07:00
parent 34b569eb5f
commit 5871bf68de

View File

@ -717,6 +717,11 @@ mod parse_tests {
parse_test!("a + b", AST(vec![Expression(binexp!(op!("+"), var!("a"), var!("b")))]));
}
#[test]
fn parsing_functions() {
parse_test!("fn oi()", AST(vec![Declaration(FuncDecl { name: rc!(oi), params: vec![] })]));
}
#[test]
fn parsing_types() {
parse_test!("type Yolo = Yolo", AST(vec![Declaration(TypeDecl(rc!(Yolo), TypeBody(vec![Variant::Singleton(rc!(Yolo))])))]));