Parcourir la source

[2374] Add one more test to numbers-that-are-strings

Jelte Jansen il y a 12 ans
Parent
commit
522f3f2bd6
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      src/lib/dns/tests/master_lexer_state_unittest.cc

+ 6 - 0
src/lib/dns/tests/master_lexer_state_unittest.cc

@@ -526,6 +526,8 @@ TEST_F(MasterLexerStateTest, stringNumbers) {
                          // as strings (unsigned integers only)
     ss << "123abc456 ";  // 'Numbers' containing non-digits should
                          // be interpreted as strings
+    ss << "123\\456 ";   // Numbers containing escaped digits are
+                         // interpreted as strings
     ss << "3scaped\\ space ";
     ss << "3scaped\\\ttab ";
     ss << "3scaped\\(paren ";
@@ -545,6 +547,10 @@ TEST_F(MasterLexerStateTest, stringNumbers) {
     stringTokenCheck("123abc456", s_number.getToken(lexer), false);
 
     EXPECT_EQ(&s_number, State::start(lexer, common_options));
+    EXPECT_EQ(s_null, s_number.handle(lexer));
+    stringTokenCheck("123\\456", s_number.getToken(lexer), false);
+
+    EXPECT_EQ(&s_number, State::start(lexer, common_options));
     EXPECT_EQ(s_null, s_number.handle(lexer)); // recognize str, see ' ' at end
     stringTokenCheck("3scaped\\ space", s_number.getToken(lexer));