From c347e6c630e65d5848303f35ca80860f9a49dca4 Mon Sep 17 00:00:00 2001 From: Marvin Schlegel Date: Thu, 16 May 2024 11:31:58 +0200 Subject: [PATCH] add test --- Test/TestParser.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Test/TestParser.hs b/Test/TestParser.hs index bf874fc..5869961 100644 --- a/Test/TestParser.hs +++ b/Test/TestParser.hs @@ -179,6 +179,9 @@ testStatementIfThenElse = TestCase $ testStatementWhile = TestCase $ assertEqual "expect while" [While (Reference "a") (Block [Block []])] $ parseStatement [WHILE,LBRACE,IDENTIFIER "a",RBRACE,LBRACKET,RBRACKET] +testStatementAssign = TestCase $ + assertEqual "expect assign 5" [StatementExpressionStatement (Assignment (Reference "a") (IntegerLiteral 5))] $ + parseStatement [IDENTIFIER "a",ASSIGN,INTEGERLITERAL 5,SEMICOLON] @@ -233,5 +236,6 @@ tests = TestList [ testExpressionPrecedence, testStatementIfThen, testStatementIfThenElse, - testStatementWhile + testStatementWhile, + testStatementAssign ] \ No newline at end of file