summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils/stringutils_unittest.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc
index c372e9dce..d3d274597 100644
--- a/src/utils/stringutils_unittest.cc
+++ b/src/utils/stringutils_unittest.cc
@@ -515,3 +515,25 @@ TEST(stringuntils, strStartWith1)
EXPECT_TRUE(strStartWith("test line", "test line"));
EXPECT_TRUE(!strStartWith("test line", "est"));
}
+
+TEST(stringuntils, encodeLinkText)
+{
+ std::string str;
+
+ str = encodeLinkText("test line");
+ EXPECT_EQ(str, "test line");
+ str = encodeLinkText("test|line");
+ EXPECT_EQ(str, "test\342\235\230line");
+ str = encodeLinkText("test||line");
+ EXPECT_EQ(str, "test\342\235\230\342\235\230line");
+}
+
+TEST(stringuntils, decodeLinkText)
+{
+ std::string str;
+
+ str = encodeLinkText("test|line");
+ EXPECT_EQ(str, "test\342\235\230line");
+ str = decodeLinkText(str);
+ EXPECT_EQ(str, "test|line");
+}