diff options
Diffstat (limited to 'writerfilter/qa')
-rw-r--r-- | writerfilter/qa/cppunittests/misc/misc.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/writerfilter/qa/cppunittests/misc/misc.cxx b/writerfilter/qa/cppunittests/misc/misc.cxx index 49e5e1b393c6..522dc19ee685 100644 --- a/writerfilter/qa/cppunittests/misc/misc.cxx +++ b/writerfilter/qa/cppunittests/misc/misc.cxx @@ -160,6 +160,26 @@ void WriterfilterMiscTest::testFieldParameters() CPPUNIT_ASSERT_EQUAL(OUString("foobar"), boost::get<2>(result)[1]); CPPUNIT_ASSERT_EQUAL(OUString("\\A"), boost::get<2>(result)[2]); CPPUNIT_ASSERT_EQUAL(OUString(), boost::get<2>(result)[3]); + + for (auto prefix : {"#", "$", "%", "&", "'", "(", ")", "*", "+", ",", + "-", ".", "/", ":", ";", "<", ">", "?", "@", "[", + "]", "^", "_", "`", "{", "|", "}", "~"}) + { + OUString test(OUString::createFromAscii(prefix) + OUString("PAGE")); + result = lcl_SplitFieldCommand(test + OUString(" ")); + CPPUNIT_ASSERT_EQUAL(test, boost::get<0>(result)); + } + result = lcl_SplitFieldCommand("\\PAGE "); + CPPUNIT_ASSERT_EQUAL(OUString("PAGE"), boost::get<0>(result)); + result = lcl_SplitFieldCommand("\\ PAGE "); + CPPUNIT_ASSERT_EQUAL(OUString("\\ "), boost::get<0>(result)); + CPPUNIT_ASSERT_EQUAL(OUString("PAGE"), boost::get<1>(result)[0]); + result = lcl_SplitFieldCommand("\\\\PAGE "); + CPPUNIT_ASSERT_EQUAL(OUString("\\PAGE"), boost::get<0>(result)); + result = lcl_SplitFieldCommand("\"PAGE\" "); + CPPUNIT_ASSERT_EQUAL(OUString("PAGE"), boost::get<0>(result)); + result = lcl_SplitFieldCommand("\"PAGE "); + CPPUNIT_ASSERT_EQUAL(OUString("PAGE "), boost::get<0>(result)); } CPPUNIT_TEST_SUITE_REGISTRATION(WriterfilterMiscTest); |