basic/qa/cppunit/test_compiler_checks.cxx |   27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

New commits:
commit a4d1a55fa6c84e662d8a64fb16b70abed155fd75
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu May 29 23:22:31 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat May 31 21:50:48 2025 +0200

    Add another test for tdf#166781
    
    Change-Id: I6618f90cd281a982d096060c891234abc1d5623e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186092
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/basic/qa/cppunit/test_compiler_checks.cxx 
b/basic/qa/cppunit/test_compiler_checks.cxx
index 2aba8a32c22e..6aa3536e2441 100644
--- a/basic/qa/cppunit/test_compiler_checks.cxx
+++ b/basic/qa/cppunit/test_compiler_checks.cxx
@@ -260,14 +260,25 @@ CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, 
testTdf162986_property_let_end_functi
 
 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture, testMissingEndIf)
 {
-    MacroSnippet aMacro(u"Sub doUnitTest(argName)
"
-                        "  If False Then
"
-                        "End Sub
"_ustr);
-    aMacro.Compile();
-    CPPUNIT_ASSERT(aMacro.HasError());
-    CPPUNIT_ASSERT_EQUAL(ERRCODE_BASIC_BAD_BLOCK, aMacro.getError().GetCode());
-    // Without the fix, this was "End Sub"
-    CPPUNIT_ASSERT_EQUAL(u"End If"_ustr, aMacro.getError().GetArg1());
+    {
+        MacroSnippet aMacro(u"Sub doUnitTest(argName)
"
+                            "  If False Then
"
+                            "End Sub
"_ustr);
+        aMacro.Compile();
+        CPPUNIT_ASSERT(aMacro.HasError());
+        CPPUNIT_ASSERT_EQUAL(ERRCODE_BASIC_BAD_BLOCK, 
aMacro.getError().GetCode());
+        // Without the fix, this was "End Sub"
+        CPPUNIT_ASSERT_EQUAL(u"End If"_ustr, aMacro.getError().GetArg1());
+    }
+    {
+        MacroSnippet aMacro(u"Sub doUnitTest(argName)
"
+                            "  If False Then
"
+                            "  End Sub
"
+                            "End Sub
"_ustr);
+        aMacro.Compile();
+        // Without the fix, this compiled without errors
+        CPPUNIT_ASSERT(aMacro.HasError());
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */

Reply via email to