Tests: Added Lexer::Type::substitution tests

This commit is contained in:
Paul Beckingham
2015-03-28 09:32:36 -04:00
parent ff445c567e
commit d0a9e9a253

View File

@@ -36,7 +36,7 @@ Context context;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv) int main (int argc, char** argv)
{ {
UnitTest t (256); UnitTest t (268);
std::vector <std::pair <std::string, Lexer::Type> > tokens; std::vector <std::pair <std::string, Lexer::Type> > tokens;
std::string token; std::string token;
@@ -411,6 +411,8 @@ int main (int argc, char** argv)
{ "~", Lexer::Type::op }, { "~", Lexer::Type::op },
{ "pattern", Lexer::Type::dom }, }, }, { "pattern", Lexer::Type::dom }, }, },
{ "desc.cont:pattern", { { "desc.cont:pattern", Lexer::Type::pair }, NOPE, NOPE }, }, { "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 }, },
}; };
#define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0])) #define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0]))