-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test files for
Parser
and ExpressionParser
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <stdio.h> | ||
|
||
#include "unit.h" | ||
#include "compiler/lexer/Lexer.h" | ||
#include "compiler/parser/Parser.h" | ||
|
||
|
||
// TODO: Tests for ExpressionParser internals here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
|
||
#include "unit.h" | ||
#include "compiler/lexer/Lexer.h" | ||
#include "compiler/parser/Parser.h" | ||
|
||
|
||
DESCRIBE(variable_declaration, "Variable declaration parsing") { | ||
Lexer lexer; | ||
Lexer_constructor(&lexer); | ||
|
||
Parser parser; | ||
Parser_constructor(&parser, &lexer); | ||
|
||
ParserResult result; | ||
|
||
TEST_BEGIN("Example use of parser") { | ||
Lexer_setSource(&lexer, "let a = 7"); | ||
result = Parser_parse(&parser); | ||
|
||
EXPECT_TRUE(result.success); | ||
} TEST_END(); | ||
} |