Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / main.cpp
diff options
context:
space:
mode:
Commitd960d239898084153bdc2a4b51d102d25a575fe0 (patch)
Author
 martin dobrev <martindobrev0@gmail.com>
2018-10-05 09:31:34 +0300
Committer
 martin dobrev <martindobrev0@gmail.com>
2018-10-14 13:10:07 +0300
Files2c410f0d3b6049029ac08579e6314f83ea38f04d /JSImpl/src/main.cpp
IPL-d960d239898084153bdc2a4b51d102d25a575fe0.tar
IPL-d960d239898084153bdc2a4b51d102d25a575fe0.tar.gz
IPL-d960d239898084153bdc2a4b51d102d25a575fe0.zip
Parentab6cd5aaa4e1ceb12ade89a4a0c5376092fa8dfb (diff)
Enhance test system usability
1 files changed, 3 insertions, 3 deletions
-rw-r--r--JSImpl/src/main.cpp6
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()