Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / main.cpp
diff options
context:
space:
mode:
1 files changed, 8 insertions, 0 deletions
-rw-r--r--JSImpl/src/main.cpp8
diff --git a/JSImpl/src/main.cpp b/JSImpl/src/main.cpp
index 13fdafc..eec4c80 100644
--- a/JSImpl/src/main.cpp
+++ b/JSImpl/src/main.cpp
@@ -51,6 +51,12 @@ void TestString()
CHECH(tokens.size() == 2 && tokens[0].Type == TokenType::String && tokens[0].Lexeme == "\"alabala\"");
}
+void TestStringSingleQuotedStrings()
+{
+ auto tokens = Tokenize("'alabala'");
+ CHECH(tokens.size() == 2 && tokens[0].Type == TokenType::String && tokens[0].Lexeme == "'alabala'");
+}
+
void TestKeyWord()
{
auto tokens = Tokenize("for");
@@ -82,9 +88,11 @@ int main()
EXECUTE_TEST(TestNumberStartWithZero);
EXECUTE_TEST(TestString);
EXECUTE_TEST(TestSpaceNewLineSpace);
+ EXECUTE_TEST(TestStringSingleQuotedStrings);
EXECUTE_TEST(TestKeyWord);
EXECUTE_TEST(TestVariableDeclaration);
+
//EXECUTE_TEST(TestParseUnaryExpr);
#if defined(_WIN32)
std::system("pause");