Add wchar.h for wide char overloads
This commit is contained in:
@@ -72,6 +72,7 @@ add_fmt_test(compile-test)
|
||||
add_fmt_test(printf-test)
|
||||
add_fmt_test(ranges-test)
|
||||
add_fmt_test(scan-test)
|
||||
add_fmt_test(wchar-test)
|
||||
|
||||
if (NOT MSVC)
|
||||
# FMT_ENFORCE_COMPILE_STRING is not supported under MSVC due to compiler bugs.
|
||||
|
||||
@@ -590,11 +590,6 @@ TEST(core_test, to_string_view_foreign_strings) {
|
||||
EXPECT_EQ(type, fmt::detail::type::string_type);
|
||||
}
|
||||
|
||||
TEST(core_test, format_foreign_strings) {
|
||||
using namespace test_ns;
|
||||
EXPECT_EQ(fmt::format(test_string<char>("{}"), 42), "42");
|
||||
}
|
||||
|
||||
struct implicitly_convertible_to_string {
|
||||
operator std::string() const { return "foo"; }
|
||||
};
|
||||
|
||||
@@ -1580,8 +1580,6 @@ TEST(format_test, print) {
|
||||
EXPECT_WRITE(stdout, fmt::print("Don't {}!", "panic"), "Don't panic!");
|
||||
EXPECT_WRITE(stderr, fmt::print(stderr, "Don't {}!", "panic"),
|
||||
"Don't panic!");
|
||||
// Check that the wide print overload compiles.
|
||||
if (fmt::detail::const_check(false)) fmt::print(L"test");
|
||||
}
|
||||
|
||||
TEST(format_test, variadic) {
|
||||
|
||||
15
test/wchar-test.cc
Normal file
15
test/wchar-test.cc
Normal file
@@ -0,0 +1,15 @@
|
||||
// Formatting library for C++ - formatting library tests
|
||||
//
|
||||
// Copyright (c) 2012 - present, Victor Zverovich
|
||||
// All rights reserved.
|
||||
//
|
||||
// For the license information refer to format.h.
|
||||
|
||||
#include "fmt/wchar.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
TEST(wchar_test, print) {
|
||||
// Check that the wide print overload compiles.
|
||||
if (fmt::detail::const_check(false)) fmt::print(L"test");
|
||||
}
|
||||
Reference in New Issue
Block a user