Skip to content
Snippets Groups Projects
Commit dd5b1018 authored by Manuel Klimek's avatar Manuel Klimek
Browse files

Fix incorrect FIXME.

The case that we wanted to write a test for cannot happen, as the
UnwrappedLineParser already protects against it. Added an assert to
prevent regressions of that assumption.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171720 91177308-0d34-0410-b5e6-96231b3b80d8
parent dac62528
No related branches found
No related tags found
No related merge requests found
...@@ -41,8 +41,9 @@ public: ...@@ -41,8 +41,9 @@ public:
} }
virtual FormatToken getNextToken() { virtual FormatToken getNextToken() {
// FIXME: Write test that breaks due to a missing // The \c UnwrappedLineParser guards against this by never calling
// if (eof()) return createEOF(); // \c getNextToken() after it has encountered the first eof token.
assert(!eof());
Token = PreviousTokenSource->getNextToken(); Token = PreviousTokenSource->getNextToken();
if (eof()) if (eof())
return createEOF(); return createEOF();
......
...@@ -394,6 +394,7 @@ TEST_F(FormatTest, FormatsSmallMacroDefinitionsInSingleLine) { ...@@ -394,6 +394,7 @@ TEST_F(FormatTest, FormatsSmallMacroDefinitionsInSingleLine) {
TEST_F(FormatTest, BreaksOnHashWhenDirectiveIsInvalid) { TEST_F(FormatTest, BreaksOnHashWhenDirectiveIsInvalid) {
EXPECT_EQ("#\n;", format("#;")); EXPECT_EQ("#\n;", format("#;"));
verifyFormat("#\n;\n;\n;");
} }
TEST_F(FormatTest, UnescapedEndOfLineEndsPPDirective) { TEST_F(FormatTest, UnescapedEndOfLineEndsPPDirective) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment