mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Added tests for Lexer::boundary.
This commit is contained in:
parent
008ba6ecab
commit
e14c867a9b
1 changed files with 10 additions and 1 deletions
|
@ -36,7 +36,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (196);
|
||||
UnitTest t (203);
|
||||
|
||||
std::vector <std::pair <std::string, Lexer::Type> > tokens;
|
||||
std::string token;
|
||||
|
@ -71,6 +71,15 @@ int main (int argc, char** argv)
|
|||
t.ok (Lexer::is_ws (0x205F), "U+205F is_ws");
|
||||
t.ok (Lexer::is_ws (0x3000), "U+3000 is_ws");
|
||||
|
||||
// static bool Lexer::boundary(int, int);
|
||||
t.ok (Lexer::boundary (' ', 'a'), "' ' --> 'a' = boundary");
|
||||
t.ok (Lexer::boundary ('a', ' '), "'a' --> ' ' = boundary");
|
||||
t.ok (Lexer::boundary (' ', '+'), "' ' --> '+' = boundary");
|
||||
t.ok (Lexer::boundary (' ', ','), "' ' --> ',' = boundary");
|
||||
t.notok (Lexer::boundary ('3', '4'), "'3' --> '4' = boundary");
|
||||
t.ok (Lexer::boundary ('(', '('), "'(' --> '(' = boundary");
|
||||
t.notok (Lexer::boundary ('r', 'd'), "'r' --> 'd' = boundary");
|
||||
|
||||
// Should result in no tokens.
|
||||
Lexer l0 ("");
|
||||
t.notok (l0.token (token, type), "'' --> no tokens");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue