mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Tests: Lexer::Type::dom and Lexer::Type::path tests
This commit is contained in:
parent
0973e6566b
commit
b02d518b02
1 changed files with 16 additions and 12 deletions
|
@ -36,7 +36,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (280);
|
||||
UnitTest t (304);
|
||||
|
||||
std::vector <std::pair <std::string, Lexer::Type> > 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]))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue