]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/testString.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / tests / testString.cc
index 033906c468954b62554357695cc67c99837c8ebe..469c1f50e1ae9d681e2217a6c140678de5ad0cbc 100644 (file)
@@ -1,11 +1,16 @@
-#if 0
-#include "squid.h"
-#endif
+/*
+ * Copyright (C) 1996-2018 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 );
 
@@ -61,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);
+}
+