From 2733bc38f08c96552e31bda5e3fc34017c81b1c2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 28 Oct 2013 09:19:42 +0100 Subject: Demonstrate that empty comments are handled just fine ...see preceding revert of a79cb836b951eb2492e43aadd2ee672b9b67b914 "COMPHELPER: Allow empty comments in SyntaxHighlight." Change-Id: Ib0a8c46c19dd7f0697b95a1c28398073a1183281 --- comphelper/qa/unit/syntaxhighlighttest.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'comphelper/qa') 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 #include 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); -- cgit