Test: Added Lexer::dequote test

This commit is contained in:
Paul Beckingham
2015-10-16 08:26:14 -04:00
parent 4f11740896
commit e4b8c2f0f5

View File

@@ -37,7 +37,7 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (1207);
UnitTest t (1208);
std::vector <std::pair <std::string, Lexer::Type>> tokens;
std::string token;
@@ -106,6 +106,10 @@ int main (int argc, char** argv)
Lexer::dequote (token);
t.is (token, "o\\'clock", "dequote 'o\\'clock' --> o\\'clock");
token = "abba";
Lexer::dequote (token, "a");
t.is (token, "bb", "dequote 'abba' (a) --> bb");
// Should result in no tokens.
Lexer l0 ("");
t.notok (l0.token (token, type), "'' --> no tokens");