From 84eb75c7055f9eb37c62b5e9015c09288d8360b5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 28 Mar 2015 10:45:19 -0400 Subject: [PATCH] Tests: Added Lexer::Type::string tests --- test/lexer.t.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/lexer.t.cpp b/test/lexer.t.cpp index 053ce4ffd..6e6f5deef 100644 --- a/test/lexer.t.cpp +++ b/test/lexer.t.cpp @@ -36,7 +36,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (346); + UnitTest t (388); std::vector > tokens; std::string token; @@ -426,6 +426,14 @@ int main (int argc, char** argv) { "a360fc44-315c-4366-b70c-ea7e7520b749.foo.bar", { { "a360fc44-315c-4366-b70c-ea7e7520b749.foo.bar", Lexer::Type::dom }, NO, NO }, }, { "http://tasktools.org", { { "http://tasktools.org", Lexer::Type::url }, NO, NO }, }, { "https://bug.tasktools.org", { { "https://bug.tasktools.org", Lexer::Type::url }, NO, NO }, }, + + { "'one two'", { { "'one two'", Lexer::Type::string }, NO, NO }, }, + { "\\\"three\\\"", { { "\\\"three\\\"", Lexer::Type::string }, NO, NO }, }, + { "'\\''", { { "'\\''", Lexer::Type::string }, NO, NO }, }, + { "\"\\\"\"", { { "\"\\\"\"", Lexer::Type::string }, NO, NO }, }, + { "\"\tfoo\t\"", { { "\"\tfoo\t\"", Lexer::Type::string }, NO, NO }, }, + { "\"\\u20A43\"", { { "\"₤3\"", Lexer::Type::string }, NO, NO }, }, + { "\"U+20AC4\"", { { "\"€4\"", Lexer::Type::string }, NO, NO }, }, }; #define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0]))