sal/qa/rtl/bootstrap/expand.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 6c3050ea8c8e168ea1fe5106bae40015e49cce05
Author:     shlok3640 <[email protected]>
AuthorDate: Mon Jan 5 07:26:15 2026 +0000
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Thu Jan 22 08:18:28 2026 +0100

    tdf#49602: Add unit test for non-recursive bootstrap macro expansion
    
    Change-Id: Iae7c8d92976696472314591111a908466a3d82a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196564
    Reviewed-by: Stephan Bergmann <[email protected]>
    Tested-by: Jenkins

diff --git a/sal/qa/rtl/bootstrap/expand.cxx b/sal/qa/rtl/bootstrap/expand.cxx
index 3d827cc2f63f..91e6dd62ce9b 100644
--- a/sal/qa/rtl/bootstrap/expand.cxx
+++ b/sal/qa/rtl/bootstrap/expand.cxx
@@ -65,7 +65,7 @@ void Test::testThreeSegments() {
         osl::File f(url);
         CPPUNIT_ASSERT_EQUAL(
             osl::FileBase::E_None, f.open(osl_File_OpenFlag_Write | 
osl_File_OpenFlag_Create));
-        char const data[] = "[section1]
key=value1
[section2]
key=value2
";
+        char const data[] = "[section1]
key=value1
[section2]
key=value2
[non_recursive_test]
macro_key=$TEST
";
         sal_uInt64 length = std::strlen(data);
         sal_uInt64 written = 0;
         CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, f.write(data, length, 
written));
@@ -98,6 +98,11 @@ void Test::testThreeSegments() {
         rtl::Bootstrap::expandMacros(s);
         CPPUNIT_ASSERT_EQUAL(u"value2"_ustr, s);
     }
+    {
+        OUString s("${" + esc + ":non_recursive_test:macro_key}");
+        rtl::Bootstrap::expandMacros(s);
+        CPPUNIT_ASSERT_EQUAL(u"$TEST"_ustr, s);
+    }
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
  • core.git: sal/qa Stephan Bergmann (via logerrit)
    • core.git: sal/qa shlok3640 (via logerrit)

Reply via email to