From 469d78d610085044845f0fba462f1d8170b62cd4 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 14 Jan 2021 17:41:13 +0100 Subject: =?UTF-8?q?Move=20let-binding=20tests=20to=20integration=20?= =?UTF-8?q?=F0=9F=9A=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parse/tests.rs | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'src/parse') diff --git a/src/parse/tests.rs b/src/parse/tests.rs index c87d43f7..8d52c24b 100644 --- a/src/parse/tests.rs +++ b/src/parse/tests.rs @@ -186,21 +186,6 @@ macro_rules! Block { }; } -macro_rules! Let { - (@$pat:expr $(=> $expr:expr)?) => {{ - #[allow(unused)] - let mut expr = None; - $(expr = Some(Box::new(into!($expr)));)? - Expr::Let(ExprLet { - pat: into!($pat).map(|s: &str| Ident(s.into())), - expr - }) - }}; - ($($tts:tt)*) => { - Node::Expr(Let!(@$($tts)*)) - }; -} - #[test] fn test_parse_raw() { // Basic, mostly tested in tokenizer and resolver. @@ -345,26 +330,3 @@ fn test_parse_values() { nodes: [], errors: [S(1..3, "expected expression, found invalid token")]); } - -#[test] -fn test_parse_let_bindings() { - // Basic let. - t!("#let x;" Let!("x")); - t!("#let _y=1;" Let!("_y" => Int(1))); - - // Followed by text. - t!("#let x = 1\n+\n2;\nHi there" - Let!("x" => Binary(Int(1), Add, Int(2))), - Space, Text("Hi"), Space, Text("there")); - - // Missing semicolon. - t!("#let x = a\nHi" - nodes: [Let!("x" => Id("a"))], - errors: [S(11..13, "unexpected identifier"), - S(13..13, "expected semicolon")]); - - // Missing identifier. - t!("#let 1;" - nodes: [], - errors: [S(5..6, "expected identifier, found integer")]) -} -- cgit v1.2.3