aboutsummaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/test_utilities.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/unittest/test_utilities.cpp b/src/unittest/test_utilities.cpp
index 447b591e1..5559cdbf2 100644
--- a/src/unittest/test_utilities.cpp
+++ b/src/unittest/test_utilities.cpp
@@ -302,9 +302,18 @@ void TestUtilities::testAsciiPrintableHelper()
void TestUtilities::testUTF8()
{
- UASSERT(wide_to_utf8(utf8_to_wide("")) == "");
- UASSERT(wide_to_utf8(utf8_to_wide("the shovel dug a crumbly node!"))
- == "the shovel dug a crumbly node!");
+ UASSERT(utf8_to_wide("¤") == L"¤");
+
+ UASSERT(wide_to_utf8(L"¤") == "¤");
+
+ UASSERTEQ(std::string, wide_to_utf8(utf8_to_wide("")), "");
+ UASSERTEQ(std::string, wide_to_utf8(utf8_to_wide("the shovel dug a crumbly node!")),
+ "the shovel dug a crumbly node!");
+ UASSERTEQ(std::string, wide_to_utf8(utf8_to_wide("-ä-")),
+ "-ä-");
+ UASSERTEQ(std::string, wide_to_utf8(utf8_to_wide("-\xF0\xA0\x80\x8B-")),
+ "-\xF0\xA0\x80\x8B-");
+
}
void TestUtilities::testRemoveEscapes()