]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/testString.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / testString.cc
index 1cf18fb0dc31d29dad3a79497026b5e05e5a8e2d..0882393d6326e454f78639137baf23e79a7e391c 100644 (file)
@@ -1,9 +1,16 @@
-#include "config.h"
+/*
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
 
-#include "testString.h"
-#include "SquidString.h"
-#include "Mem.h"
+#include "squid.h"
 #include "event.h"
+#include "SquidString.h"
+#include "testString.h"
+#include "unitTestMain.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( testString );
 
@@ -59,3 +66,12 @@ testString::testCmpNotEmptyDefault()
     CPPUNIT_ASSERT(right.cmp("foo") < 0);
     CPPUNIT_ASSERT(right.cmp("foo", 1) < 0);
 }
+
+void testString::testSubstr()
+{
+    String s("0123456789");
+    String check=s.substr(3,5);
+    String ref("34");
+    CPPUNIT_ASSERT(check == ref);
+}
+