diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-23 01:59:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-23 01:59:17 +0300 |
commit | 636a9a5bf54b400e9f46c321e59107a644e06916 (patch) | |
tree | 1d23a3edcab3c44bedf3045258a937d6db6e5210 /src/utils | |
parent | 6969655f6d251f0c638c11c8561493e938695fa0 (diff) | |
download | ManaVerse-636a9a5bf54b400e9f46c321e59107a644e06916.tar.gz ManaVerse-636a9a5bf54b400e9f46c321e59107a644e06916.tar.bz2 ManaVerse-636a9a5bf54b400e9f46c321e59107a644e06916.tar.xz ManaVerse-636a9a5bf54b400e9f46c321e59107a644e06916.zip |
add missing stringutils unit tests.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/stringutils_unittest.cc | 22 |
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"); +} |