summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-10-28 09:19:42 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-10-28 10:47:19 +0100
commit2733bc38f08c96552e31bda5e3fc34017c81b1c2 (patch)
treea252b6be75d2a3b3c03406991c2d3d10320f21f5 /comphelper
parenta699e7c70d312c96d0dbb8eb4c31b81129dcf7b2 (diff)
Demonstrate that empty comments are handled just fine
...see preceding revert of a79cb836b951eb2492e43aadd2ee672b9b67b914 "COMPHELPER: Allow empty comments in SyntaxHighlight." Change-Id: Ib0a8c46c19dd7f0697b95a1c28398073a1183281
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/qa/unit/syntaxhighlighttest.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/comphelper/qa/unit/syntaxhighlighttest.cxx b/comphelper/qa/unit/syntaxhighlighttest.cxx
index 8fab0677d4eb..c576f7b7d85a 100644
--- a/comphelper/qa/unit/syntaxhighlighttest.cxx
+++ b/comphelper/qa/unit/syntaxhighlighttest.cxx
@@ -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);