summaryrefslogtreecommitdiff
path: root/src/string_utils.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-12-07 01:56:02 +0800
committerMaxime Coste <mawww@kakoune.org>2017-12-07 01:56:02 +0800
commit2f48bbf6ff0c2bad4d06ce1189cd8e0e50d7a447 (patch)
treea4c40a6db41aaa483f947135023e981a9d43089c /src/string_utils.cc
parent99636c6230f9a3f6a818db5a301137114bf79617 (diff)
Tweak unescape template function to unescape the escape char as well
Test that more thouroughly in the unit tests.
Diffstat (limited to 'src/string_utils.cc')
-rw-r--r--src/string_utils.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string_utils.cc b/src/string_utils.cc
index 55c7562e..628bff32 100644
--- a/src/string_utils.cc
+++ b/src/string_utils.cc
@@ -351,8 +351,8 @@ UnitTest test_string{[]()
kak_assert(wrapped2[1] == "unknown");
kak_assert(wrapped2[2] == "type");
- kak_assert(escape("youpi:matin:tchou:", ':', '\\') == "youpi\\:matin\\:tchou\\:");
- kak_assert(unescape("youpi\\:matin\\:tchou\\:", ':', '\\') == "youpi:matin:tchou:");
+ kak_assert(escape(R"(\youpi:matin:tchou\:)", ":\\", '\\') == R"(\\youpi\:matin\:tchou\\\:)");
+ kak_assert(unescape(R"(\\youpi\:matin\:tchou\\\:)", ":\\", '\\') == R"(\youpi:matin:tchou\:)");
kak_assert(prefix_match("tchou kanaky", "tchou"));
kak_assert(prefix_match("tchou kanaky", "tchou kanaky"));