add test
This commit is contained in:
parent
f81a812f59
commit
c347e6c630
@ -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
|
||||
]
|
Loading…
Reference in New Issue
Block a user