diff options
| Commit | 2621d30da58795a19fa2c90978f766e173a8ca2f (patch) | |
|---|---|---|
| Author | 2018-10-14 15:11:59 +0300 | |
| Committer | 2018-10-14 15:11:59 +0300 | |
| Files | b85eefde3ea7b5a39a355e7ff13e38debeadb31d /JSImpl/src/main.cpp | |
| IPL-2621d30da58795a19fa2c90978f766e173a8ca2f.tar IPL-2621d30da58795a19fa2c90978f766e173a8ca2f.tar.gz IPL-2621d30da58795a19fa2c90978f766e173a8ca2f.zip | ||
| Parent | ab6cd5aaa4e1ceb12ade89a4a0c5376092fa8dfb (diff) | |
| Parent | 47a7a68e2b7ce0b0c1e2bd1097927a91623fbcc5 (diff) | |
Merge branch 'expressions-rework'
1 files changed, 3 insertions, 3 deletions
| -rw-r--r-- | JSImpl/src/main.cpp | 6 |
diff --git a/JSImpl/src/main.cpp b/JSImpl/src/main.cpp index 221ec52..4263bfa 100644 --- a/JSImpl/src/main.cpp +++ b/JSImpl/src/main.cpp @@ -5,18 +5,19 @@ #define EXECUTE_TEST(test) std::cout << #test << " "; test(); #define CHECK(cond) if (cond) {LOG("PASS");} else {LOG(#cond " FAIL");} +#define CHECK(cond) cond ? LOG("PASS") : LOG("FAIL") + // Lexer Tests void TestLess() { auto tokens = Tokenize("<"); CHECK(tokens.size() == 2 && tokens[0].Type == TokenType::Less); - } void TestNumber() { auto tokens = Tokenize("213434.24"); - CHECK(tokens.size() == 2 && tokens[0].Type == TokenType::Number && tokens[0].Number == 213434.24) + CHECK(tokens.size() == 2 && tokens[0].Type == TokenType::Number && tokens[0].Number == 213434.24); } void TestNumberStartWithNine() @@ -73,7 +74,6 @@ void TestParseUnaryExpr() { // TODO make actual test :D auto expr = Parse(Tokenize("function pesho() { var a = 0; return a; }")); - expr->Print(std::cout); } int main() |
