Kaydet (Commit) 2733bc38 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Demonstrate that empty comments are handled just fine

...see preceding revert of a79cb836 "COMPHELPER:
Allow empty comments in SyntaxHighlight."

Change-Id: Ib0a8c46c19dd7f0697b95a1c28398073a1183281
üst a699e7c7
......@@ -14,6 +14,7 @@
#include "cppunit/plugin/TestPlugIn.h"
#include "rtl/ustring.hxx"
#include <cassert>
#include <vector>
class SyntaxHighlightTest : public CppUnit::TestFixture
......@@ -45,6 +46,13 @@ void SyntaxHighlightTest::testBasicString()
prevEnd = itr->nEnd;
}
CPPUNIT_ASSERT_EQUAL(aBasicString.getLength(), prevEnd);
// The last portion is an empty comment consisting just of the leading
// apostrophe:
assert(!aPortions.empty());
CPPUNIT_ASSERT_EQUAL(98, aPortions.back().nBegin);
CPPUNIT_ASSERT_EQUAL(99, aPortions.back().nEnd);
CPPUNIT_ASSERT_EQUAL(TT_COMMENT, aPortions.back().tokenType);
}
CPPUNIT_TEST_SUITE_REGISTRATION(SyntaxHighlightTest);
......
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