Flutter Engine
Loading...
Searching...
No Matches
string_conversion_unittests.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
flutter/fml/string_conversion.h
"
6
7
#include "gtest/gtest.h"
8
9
namespace
fml
{
10
namespace
testing {
11
12
TEST
(StringConversion, Utf16ToUtf16Empty) {
13
EXPECT_EQ(
Utf8ToUtf16
(
""
), u
""
);
14
}
15
16
TEST
(StringConversion, Utf8ToUtf16Ascii) {
17
EXPECT_EQ(
Utf8ToUtf16
(
"abc123"
), u
"abc123"
);
18
}
19
20
TEST
(StringConversion, Utf8ToUtf16Unicode) {
21
EXPECT_EQ(
Utf8ToUtf16
(
"\xe2\x98\x83"
), u
"\x2603"
);
22
}
23
24
TEST
(StringConversion, Utf16ToUtf8Empty) {
25
EXPECT_EQ(
Utf16ToUtf8
(u
""
),
""
);
26
}
27
28
TEST
(StringConversion, Utf16ToUtf8Ascii) {
29
EXPECT_EQ(
Utf16ToUtf8
(u
"abc123"
),
"abc123"
);
30
}
31
32
TEST
(StringConversion, Utf16ToUtf8Unicode) {
33
EXPECT_EQ(
Utf16ToUtf8
(u
"\x2603"
),
"\xe2\x98\x83"
);
34
}
35
36
}
// namespace testing
37
}
// namespace fml
fml::testing::TEST
TEST(BacktraceTest, CanGatherBacktrace)
Definition
backtrace_unittests.cc:13
fml
Definition
ascii_trie.cc:9
fml::Utf16ToUtf8
std::string Utf16ToUtf8(const std::u16string_view string)
Definition
string_conversion.cc:37
fml::Utf8ToUtf16
std::u16string Utf8ToUtf16(const std::string_view string)
Definition
string_conversion.cc:42
string_conversion.h
fml
string_conversion_unittests.cc
Generated on Thu Nov 6 2025 16:11:22 for Flutter Engine by
1.9.8