[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd-3-2' - test/WhiteBoxTests.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Jul 18 14:38:07 UTC 2018


 test/WhiteBoxTests.cpp |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit a650f91de8bbbf6074767312fbb3540df9324bd2
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Jul 18 10:30:22 2018 -0400

    wsd: more string split tests
    
    Change-Id: Idd6e99954b11238eaf64e11e7969d0aee1612557
    Reviewed-on: https://gerrit.libreoffice.org/57648
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp
index c291f9fc3..e2c498258 100644
--- a/test/WhiteBoxTests.cpp
+++ b/test/WhiteBoxTests.cpp
@@ -183,6 +183,28 @@ void WhiteBoxTests::testSplitting()
     CPPUNIT_ASSERT_EQUAL(std::string("a"), first);
     CPPUNIT_ASSERT_EQUAL(std::string(""), second);
 
+
+    // Split first, remove delim.
+    std::tie(first, second) = Util::split(std::string("a."), '.', true);
+    CPPUNIT_ASSERT_EQUAL(std::string("a"), first);
+    CPPUNIT_ASSERT_EQUAL(std::string(""), second);
+
+    // Split first, keep delim.
+    std::tie(first, second) = Util::split(std::string("a."), '.', false);
+    CPPUNIT_ASSERT_EQUAL(std::string("a"), first);
+    CPPUNIT_ASSERT_EQUAL(std::string("."), second);
+
+    // Split first, remove delim.
+    std::tie(first, second) = Util::splitLast(std::string("a."), '.', true);
+    CPPUNIT_ASSERT_EQUAL(std::string("a"), first);
+    CPPUNIT_ASSERT_EQUAL(std::string(""), second);
+
+    // Split first, keep delim.
+    std::tie(first, second) = Util::splitLast(std::string("a."), '.', false);
+    CPPUNIT_ASSERT_EQUAL(std::string("a"), first);
+    CPPUNIT_ASSERT_EQUAL(std::string("."), second);
+
+
     // Split first, remove delim.
     std::tie(first, second) = Util::split(std::string("aa.bb"), '.', true);
     CPPUNIT_ASSERT_EQUAL(std::string("aa"), first);


More information about the Libreoffice-commits mailing list