Test: Added Lexer::dequote test
This commit is contained in:
@@ -37,7 +37,7 @@ Context context;
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int main (int argc, char** argv)
|
int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
UnitTest t (1207);
|
UnitTest t (1208);
|
||||||
|
|
||||||
std::vector <std::pair <std::string, Lexer::Type>> tokens;
|
std::vector <std::pair <std::string, Lexer::Type>> tokens;
|
||||||
std::string token;
|
std::string token;
|
||||||
@@ -106,6 +106,10 @@ int main (int argc, char** argv)
|
|||||||
Lexer::dequote (token);
|
Lexer::dequote (token);
|
||||||
t.is (token, "o\\'clock", "dequote 'o\\'clock' --> o\\'clock");
|
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.
|
// Should result in no tokens.
|
||||||
Lexer l0 ("");
|
Lexer l0 ("");
|
||||||
t.notok (l0.token (token, type), "'' --> no tokens");
|
t.notok (l0.token (token, type), "'' --> no tokens");
|
||||||
|
|||||||
Reference in New Issue
Block a user