summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/qa/cppunit/test_urlobj.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index 00ca3f720621..2dfc092d5adb 100644
--- a/tools/qa/cppunit/test_urlobj.cxx
+++ b/tools/qa/cppunit/test_urlobj.cxx
@@ -357,6 +357,16 @@ namespace tools_urlobj
!INetURLObject("vnd.sun.star.pkg://example.org").isAnyKnownWebDAVScheme());
}
+ void testSetExtension() {
+ INetURLObject obj("file:///foo/bar.baz/");
+ bool ok = obj.setExtension(
+ "other", INetURLObject::LAST_SEGMENT, false);
+ CPPUNIT_ASSERT(ok);
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("file:///foo/bar.baz/.other"),
+ obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ }
+
// Change the following lines only, if you add, remove or rename
// member functions of the current class,
// because these macros are need by auto register mechanism.
@@ -373,6 +383,7 @@ namespace tools_urlobj
CPPUNIT_TEST( urlobjTest_data );
CPPUNIT_TEST( urlobjTest_isSchemeEqualTo );
CPPUNIT_TEST( urlobjTest_isAnyKnownWebDAVScheme );
+ CPPUNIT_TEST( testSetExtension );
CPPUNIT_TEST_SUITE_END( );
}; // class createPool