From b02d518b023dd0c91395a2c417b09e8303b47e50 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 28 Mar 2015 10:06:56 -0400 Subject: [PATCH] Tests: Lexer::Type::dom and Lexer::Type::path tests --- test/lexer.t.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/test/lexer.t.cpp b/test/lexer.t.cpp index cc1788084..b246fe47c 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 (280); + UnitTest t (304); std::vector > tokens; std::string token; @@ -404,17 +404,21 @@ int main (int argc, char** argv) } results[3]; } lexerTests[] = { - { "/foo/", { { "/foo/", Lexer::Type::pattern }, NOPE, NOPE }, }, - { "/a\\/b/", { { "/a\\/b/", Lexer::Type::pattern }, NOPE, NOPE }, }, - { "/'/", { { "/'/", Lexer::Type::pattern }, NOPE, NOPE }, }, - { "desc~pattern", { { "desc", Lexer::Type::dom }, - { "~", Lexer::Type::op }, - { "pattern", Lexer::Type::dom }, }, }, - { "desc.cont:pattern", { { "desc.cont:pattern", Lexer::Type::pair }, NOPE, NOPE }, }, - { "/from/to/g", { { "/from/to/g", Lexer::Type::substitution }, NOPE, NOPE }, }, - { "/from/to/", { { "/from/to/", Lexer::Type::substitution }, NOPE, NOPE }, }, - { "+tag", { { "+tag", Lexer::Type::tag }, NOPE, NOPE }, }, - { "-tag", { { "-tag", Lexer::Type::tag }, NOPE, NOPE }, }, + { "/foo/", { { "/foo/", Lexer::Type::pattern }, NOPE, NOPE }, }, + { "/a\\/b/", { { "/a\\/b/", Lexer::Type::pattern }, NOPE, NOPE }, }, + { "/'/", { { "/'/", Lexer::Type::pattern }, NOPE, NOPE }, }, + { "desc~pattern", { { "desc", Lexer::Type::dom }, + { "~", Lexer::Type::op }, + { "pattern", Lexer::Type::dom }, }, }, + { "desc.cont:pattern", { { "desc.cont:pattern", Lexer::Type::pair }, NOPE, NOPE }, }, + { "/from/to/g", { { "/from/to/g", Lexer::Type::substitution }, NOPE, NOPE }, }, + { "/from/to/", { { "/from/to/", Lexer::Type::substitution }, NOPE, NOPE }, }, + { "+tag", { { "+tag", Lexer::Type::tag }, NOPE, NOPE }, }, + { "-tag", { { "-tag", Lexer::Type::tag }, NOPE, NOPE }, }, + { "foo", { { "foo", Lexer::Type::dom }, NOPE, NOPE }, }, + { "/long/path/to/file.txt", { { "/long/path/to/file.txt", Lexer::Type::path }, NOPE, NOPE }, }, + { "Çirçös", { { "Çirçös", Lexer::Type::dom }, NOPE, NOPE }, }, + { "☺", { { "☺", Lexer::Type::dom }, NOPE, NOPE }, }, }; #define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0]))