diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-17 03:13:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-17 14:19:17 +0300 |
commit | 41141188d70dd7d6e0b8667bda9d0f6569c0b97b (patch) | |
tree | 4ed6186d9805fe3240fd3f574faa4455ca9e3fa9 /src/utils/stringutils_unittest.cc | |
parent | fcf4c08536267a7be624b057c28586f510c0af2c (diff) | |
download | plus-41141188d70dd7d6e0b8667bda9d0f6569c0b97b.tar.gz plus-41141188d70dd7d6e0b8667bda9d0f6569c0b97b.tar.bz2 plus-41141188d70dd7d6e0b8667bda9d0f6569c0b97b.tar.xz plus-41141188d70dd7d6e0b8667bda9d0f6569c0b97b.zip |
Add support for adding cards into item links in chat.
Diffstat (limited to 'src/utils/stringutils_unittest.cc')
-rw-r--r-- | src/utils/stringutils_unittest.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc index e2db8eed1..d2dfcdf62 100644 --- a/src/utils/stringutils_unittest.cc +++ b/src/utils/stringutils_unittest.cc @@ -625,6 +625,14 @@ TEST_CASE("stringuntils replaceItemLinks") str = "[qqq]"; replaceItemLinks(str); REQUIRE(str == "[qqq]"); + + str = "[,]"; + replaceItemLinks(str); + REQUIRE(str == "[,]"); + + str = "[, ]"; + replaceItemLinks(str); + REQUIRE(str == "[, ]"); } SECTION("simple") @@ -653,6 +661,14 @@ TEST_CASE("stringuntils replaceItemLinks") str = "[test name 1] [no link]"; replaceItemLinks(str); REQUIRE(str == "[@@123456|test name 1@@] [no link]"); + + str = "[test name 1,test name 2]"; + replaceItemLinks(str); + REQUIRE(str == "[@@123456,123|test name 1@@]"); + + str = "[test name 1, test name 2 ]"; + replaceItemLinks(str); + REQUIRE(str == "[@@123456,123|test name 1@@]"); } SECTION("broken") @@ -770,5 +786,21 @@ TEST_CASE("stringuntils replaceItemLinks") str = "[[test name 1[]test name 1]"; replaceItemLinks(str); REQUIRE(str == "[[test name 1[]test name 1]"); + + str = "[[test name 1],test name2,test name 1]"; + replaceItemLinks(str); + REQUIRE(str == "[[@@123456|test name 1@@],test name2,test name 1]"); + + str = "[[ test name 1], test name2,test name 1 ]"; + replaceItemLinks(str); + REQUIRE(str == "[[@@123456|test name 1@@], test name2,test name 1 ]"); + + str = "[[test name 1,test name2[]test name 1]"; + replaceItemLinks(str); + REQUIRE(str == "[[test name 1,test name2[]test name 1]"); + + str = "[[test name 1 ,test name2[] test name 1]"; + replaceItemLinks(str); + REQUIRE(str == "[[test name 1 ,test name2[] test name 1]"); } } |