summaryrefslogtreecommitdiff
path: root/core/fxcrt/widestring_unittest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/widestring_unittest.cpp')
-rw-r--r--core/fxcrt/widestring_unittest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/fxcrt/widestring_unittest.cpp b/core/fxcrt/widestring_unittest.cpp
index 9d38aa45e9..160dc929db 100644
--- a/core/fxcrt/widestring_unittest.cpp
+++ b/core/fxcrt/widestring_unittest.cpp
@@ -1025,6 +1025,27 @@ TEST(WideString, ToDefANSI) {
.ToDefANSI());
}
+TEST(WideString, FromLocal) {
+ EXPECT_EQ(L"", WideString::FromLocal(ByteStringView()));
+#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
+ const wchar_t* kResult =
+ L"x"
+ L"\u20ac"
+ L"\u00ff"
+ L"y";
+#else
+ const wchar_t* kResult =
+ L"x"
+ L"\u0080"
+ L"\u00ff"
+ L"y";
+#endif
+ EXPECT_EQ(kResult, WideString::FromLocal("x"
+ "\x80"
+ "\xff"
+ "y"));
+}
+
TEST(WideStringView, FromVector) {
std::vector<WideStringView::UnsignedType> null_vec;
WideStringView null_string(null_vec);