aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/DivideStringTest.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/DivideStringTest.hxx b/test/DivideStringTest.hxx
index 83c54dc56..f6c01bdde 100644
--- a/test/DivideStringTest.hxx
+++ b/test/DivideStringTest.hxx
@@ -15,6 +15,7 @@ class DivideStringTest : public CppUnit::TestFixture {
CPPUNIT_TEST(TestBasic);
CPPUNIT_TEST(TestEmpty);
CPPUNIT_TEST(TestFail);
+ CPPUNIT_TEST(TestStrip);
CPPUNIT_TEST_SUITE_END();
public:
@@ -41,4 +42,13 @@ public:
const DivideString ds(input, '.');
CPPUNIT_ASSERT(!ds.IsDefined());
}
+
+ void TestStrip() {
+ constexpr char input[] = " foo\t.\nbar\r";
+ const DivideString ds(input, '.', true);
+ CPPUNIT_ASSERT(ds.IsDefined());
+ CPPUNIT_ASSERT(!ds.IsEmpty());
+ CPPUNIT_ASSERT_EQUAL(0, strcmp(ds.GetFirst(), "foo"));
+ CPPUNIT_ASSERT_EQUAL(input + 7, ds.GetSecond());
+ }
};