Commit 843eaa0b authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2373] added a test for qstring: confirm separators are regarded as part of str

parent c3d39b62
......@@ -362,7 +362,12 @@ TEST_F(MasterLexerStateTest, stringEscape) {
TEST_F(MasterLexerStateTest, quotedString) {
ss << "\"ignore-quotes\"\n";
ss << "\"quoted string\" ";
ss << "\"quoted string\" "; // space is part of the qstring
// also check other separator characters. note that \r doesn't cause
// UNBALANCED_QUOTES. Not sure if it's intentional, but that's how the
// BIND 9 version works, so we follow it (it should be too minor to matter
// in practice anyway)
ss << "\"quoted()\t\rstring\" ";
ss << "\"escape\\ in quote\" ";
ss << "\"escaped\\\"\" ";
ss << "\"escaped backslash\\\\\" ";
......@@ -384,6 +389,11 @@ TEST_F(MasterLexerStateTest, quotedString) {
EXPECT_EQ(s_null, s_qstring.handle(lexer));
stringTokenCheck("quoted string", s_string.getToken(lexer), true);
// Also checks other separator characters within a qstring
EXPECT_EQ(&s_qstring, State::start(lexer, options));
EXPECT_EQ(s_null, s_qstring.handle(lexer));
stringTokenCheck("quoted()\t\rstring", s_string.getToken(lexer), true);
// escape character mostly doesn't have any effect in the qstring
// processing
EXPECT_EQ(&s_qstring, State::start(lexer, options));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment