]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2375] Test ungetting after EOF
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 19 Nov 2012 16:27:33 +0000 (17:27 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 19 Nov 2012 16:27:33 +0000 (17:27 +0100)
src/lib/dns/tests/master_lexer_unittest.cc

index 24e188625bfbfb393c195ba78e0c670dadbf559f..2eb0c3a9ae654f7d0c54fe9c35ae1ac957e2e816 100644 (file)
@@ -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