Browse Source

[2375] Test ungetting after EOF

Michal 'vorner' Vaner 12 years ago
parent
commit
99aed51b37
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/lib/dns/tests/master_lexer_unittest.cc

+ 3 - 0
src/lib/dns/tests/master_lexer_unittest.cc

@@ -268,6 +268,9 @@ TEST_F(MasterLexerTest, eof) {
     EXPECT_EQ(MasterLexer::Token::END_OF_FILE, lexer.getNextToken().getType());
     // And it is not allowed to use this one any more.
     EXPECT_THROW(lexer.getNextToken(), isc::InvalidOperation);
+    // But if we unget a step back, we should get the EOF again
+    lexer.ungetToken();
+    EXPECT_EQ(MasterLexer::Token::END_OF_FILE, lexer.getNextToken().getType());
 }
 
 // Check we properly return error when there's an opened parentheses and no