summaryrefslogtreecommitdiff
path: root/basic/qa
diff options
context:
space:
mode:
Diffstat (limited to 'basic/qa')
-rw-r--r--basic/qa/cppunit/test_scanner.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/basic/qa/cppunit/test_scanner.cxx b/basic/qa/cppunit/test_scanner.cxx
index 9b80c32512d6..7515b0d07862 100644
--- a/basic/qa/cppunit/test_scanner.cxx
+++ b/basic/qa/cppunit/test_scanner.cxx
@@ -46,6 +46,7 @@ namespace
void testDataType();
void testHexOctal();
void testTdf103104();
+ void testTdf136032();
// Adds code needed to register the test suite
CPPUNIT_TEST_SUITE(ScannerTest);
@@ -62,6 +63,7 @@ namespace
CPPUNIT_TEST(testDataType);
CPPUNIT_TEST(testHexOctal);
CPPUNIT_TEST(testTdf103104);
+ CPPUNIT_TEST(testTdf136032);
// End of test suite definition
CPPUNIT_TEST_SUITE_END();
@@ -1061,6 +1063,21 @@ namespace
CPPUNIT_ASSERT_EQUAL(cr, symbols[3].text);
}
+ void ScannerTest::testTdf136032()
+ {
+ std::vector<Symbol> symbols;
+ sal_Int32 errors;
+
+ // tdf#136032 - abort scan of a string beginning with a hashtag,
+ // if a comma/whitespace is found. Otherwise, the compiler raises a syntax error.
+ symbols = getSymbols("Print #i,\"A#B\"", errors);
+ CPPUNIT_ASSERT_EQUAL(size_t(5), symbols.size());
+ CPPUNIT_ASSERT_EQUAL(0u, static_cast<unsigned int>(errors));
+ symbols = getSymbols("Print #i, \"A#B\"", errors);
+ CPPUNIT_ASSERT_EQUAL(size_t(5), symbols.size());
+ CPPUNIT_ASSERT_EQUAL(0u, static_cast<unsigned int>(errors));
+ }
+
// Put the test suite in the registry
CPPUNIT_TEST_SUITE_REGISTRATION(ScannerTest);
} // namespace