Index: uspace/lib/cpp/include/internal/test/tests.hpp
===================================================================
--- uspace/lib/cpp/include/internal/test/tests.hpp	(revision d49bae9927fa2e3dc5bcd55f98d58a9366af72a0)
+++ uspace/lib/cpp/include/internal/test/tests.hpp	(revision 035a35c2d41f69bc152ccb4925a6aa2e5a17243e)
@@ -74,4 +74,5 @@
             void test_find();
             void test_substr();
+            void test_compare();
     };
 }
Index: uspace/lib/cpp/src/internal/test/string.cpp
===================================================================
--- uspace/lib/cpp/src/internal/test/string.cpp	(revision d49bae9927fa2e3dc5bcd55f98d58a9366af72a0)
+++ uspace/lib/cpp/src/internal/test/string.cpp	(revision 035a35c2d41f69bc152ccb4925a6aa2e5a17243e)
@@ -46,4 +46,5 @@
         test_find();
         test_substr();
+        test_compare();
 
         return end();
@@ -665,3 +666,40 @@
         );
     }
+
+    void string_test::test_compare()
+    {
+        std::string str1{"aabbb"};
+        std::string str2{"bbbaa"};
+        std::string str3{"bbb"};
+
+        auto res = str1.compare(str1);
+        test_eq(
+            "compare equal",
+            res, 0
+        );
+
+        res = str1.compare(str2.c_str());
+        test_eq(
+            "compare less",
+            res, -1
+        );
+
+        res = str2.compare(str1);
+        test_eq(
+            "compare greater",
+            res, 1
+        );
+
+        res = str1.compare(2, 3, str2);
+        test_eq(
+            "compare substring less",
+            res, -1
+        );
+
+        res = str1.compare(2, 3, str3);
+        test_eq(
+            "compare substring equal",
+            res, 0
+        );
+    }
 }
