diff options
Diffstat (limited to 'test/test_format.cpp')
-rw-r--r-- | test/test_format.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_format.cpp b/test/test_format.cpp index b9d373c..738b551 100644 --- a/test/test_format.cpp +++ b/test/test_format.cpp @@ -709,4 +709,13 @@ TEST(FormatTest, TwoArgFormatTest) EXPECT_STREQ(sink.c_str(), expected.c_str()); } +TEST(FormatTest, StringView) +{ + String sink{}; + auto expected = std::format("Test {}", std::string_view{"Hello, World!"}); + auto formatResult = format(sink, FormatCharMode::Unchecked, u8"Test {}", StringView{u8"Hello, World!"}); + EXPECT_TRUE(formatResult.isOkay()); + EXPECT_STREQ(sink.c_str(), expected.c_str()); +} + } // namespace fud |