From 5bdd877c5f96edff37205dfacaa412f41ecb1634 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Thu, 11 Jul 2024 10:03:33 +0100 Subject: [PATCH] fix(developer): add two text after trailing spaces test cases --- .../src/kmcmplib/tests/gtest-compiler-test.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/developer/src/kmcmplib/tests/gtest-compiler-test.cpp b/developer/src/kmcmplib/tests/gtest-compiler-test.cpp index 590a9d3714..65732ab01f 100644 --- a/developer/src/kmcmplib/tests/gtest-compiler-test.cpp +++ b/developer/src/kmcmplib/tests/gtest-compiler-test.cpp @@ -472,6 +472,22 @@ TEST_F(CompilerTest, GetDelimitedString_test) { EXPECT_EQ(0, u16cmp(u"b ", q)); EXPECT_EQ(' ', *p); EXPECT_EQ(6, p-str); // last space after the close delimiter + + // single-character argument, two spaces and text after close delimiter, cut open and close delimiter, valid + u16cpy(str, u"(b) def"); + p = str; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + EXPECT_EQ(0, u16cmp(u"b", q)); + EXPECT_EQ('d', *p); + EXPECT_EQ(5, p-str); // first text character after the close delimiter + + // single-character argument, two spaces and text after close delimiter, no flags, valid + u16cpy(str, u"(b) def"); + p = str; + q = GetDelimitedString(&p, u"()", 0x00); + EXPECT_EQ(0, u16cmp(u"b", q)); + EXPECT_EQ('d', *p); + EXPECT_EQ(5, p-str); // first text character after the close delimiter } // LinePrefixType GetLinePrefixType(PKMX_WCHAR *p)