Index: uspace/lib/cpp/include/internal/test/tests.hpp
===================================================================
--- uspace/lib/cpp/include/internal/test/tests.hpp	(revision 509738fde14966900e038b12e07bb95202db7c02)
+++ uspace/lib/cpp/include/internal/test/tests.hpp	(revision d49bae9927fa2e3dc5bcd55f98d58a9366af72a0)
@@ -73,4 +73,5 @@
             void test_copy();
             void test_find();
+            void test_substr();
     };
 }
Index: uspace/lib/cpp/src/internal/test/string.cpp
===================================================================
--- uspace/lib/cpp/src/internal/test/string.cpp	(revision 509738fde14966900e038b12e07bb95202db7c02)
+++ uspace/lib/cpp/src/internal/test/string.cpp	(revision d49bae9927fa2e3dc5bcd55f98d58a9366af72a0)
@@ -45,4 +45,5 @@
         test_copy();
         test_find();
+        test_substr();
 
         return end();
@@ -634,3 +635,33 @@
         );
     }
+
+    void string_test::test_substr()
+    {
+        std::string check1{"abcd"};
+        std::string check2{"bcd"};
+        std::string check3{"def"};
+
+        std::string str{"abcdef"};
+        auto substr1 = str.substr(0, 4);
+        auto substr2 = str.substr(1, 3);
+        auto substr3 = str.substr(3);
+
+        test_eq(
+            "prefix substring",
+            substr1.begin(), substr1.end(),
+            check1.begin(), check1.end()
+        );
+
+        test_eq(
+            "substring",
+            substr2.begin(), substr2.end(),
+            check2.begin(), check2.end()
+        );
+
+        test_eq(
+            "suffix substring",
+            substr3.begin(), substr3.end(),
+            check3.begin(), check3.end()
+        );
+    }
 }
