mirror of
https://github.com/fmtlib/fmt.git
synced 2026-04-29 10:13:37 +02:00
Deprecate u8string_view
This commit is contained in:
+1
-22
@@ -2467,27 +2467,10 @@ TEST(FormatTest, FmtStringInTemplate) {
|
||||
using fmt::char8_t;
|
||||
#endif
|
||||
|
||||
TEST(FormatTest, ConstructU8StringViewFromCString) {
|
||||
fmt::u8string_view s("ab");
|
||||
EXPECT_EQ(s.size(), 2u);
|
||||
const char8_t* data = s.data();
|
||||
EXPECT_EQ(data[0], 'a');
|
||||
EXPECT_EQ(data[1], 'b');
|
||||
}
|
||||
|
||||
TEST(FormatTest, ConstructU8StringViewFromDataAndSize) {
|
||||
fmt::u8string_view s("foobar", 3);
|
||||
EXPECT_EQ(s.size(), 3u);
|
||||
const char8_t* data = s.data();
|
||||
EXPECT_EQ(data[0], 'f');
|
||||
EXPECT_EQ(data[1], 'o');
|
||||
EXPECT_EQ(data[2], 'o');
|
||||
}
|
||||
|
||||
#if FMT_USE_USER_DEFINED_LITERALS
|
||||
TEST(FormatTest, U8StringViewLiteral) {
|
||||
using namespace fmt::literals;
|
||||
fmt::u8string_view s = "ab"_u;
|
||||
fmt::basic_string_view<char8_t> s = "ab"_u;
|
||||
EXPECT_EQ(s.size(), 2u);
|
||||
const char8_t* data = s.data();
|
||||
EXPECT_EQ(data[0], 'a');
|
||||
@@ -2496,10 +2479,6 @@ TEST(FormatTest, U8StringViewLiteral) {
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(FormatTest, FormatU8String) {
|
||||
EXPECT_EQ(format(fmt::u8string_view("{}"), 42), fmt::u8string_view("42"));
|
||||
}
|
||||
|
||||
TEST(FormatTest, EmphasisNonHeaderOnly) {
|
||||
// Ensure this compiles even if FMT_HEADER_ONLY is not defined.
|
||||
EXPECT_EQ(fmt::format(fmt::emphasis::bold, "bold error"),
|
||||
|
||||
Reference in New Issue
Block a user