mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-13 06:30:06 +00:00
Don't use deprecated API.
This commit is contained in:
parent
421cb0ad18
commit
0914c91284
2
format.h
2
format.h
@ -1611,7 +1611,7 @@ template <typename Char, typename T>
|
||||
void format(BasicWriter<Char> &w, const FormatSpec &spec, const T &value) {
|
||||
std::basic_ostringstream<Char> os;
|
||||
os << value;
|
||||
w.Write(os.str(), spec);
|
||||
w.write(os.str(), spec);
|
||||
}
|
||||
|
||||
namespace internal {
|
||||
|
@ -1324,7 +1324,7 @@ class Answer {};
|
||||
|
||||
template <typename Char>
|
||||
void format(BasicWriter<Char> &w, const fmt::FormatSpec &spec, Answer) {
|
||||
w.Write("42", spec);
|
||||
w.write("42", spec);
|
||||
}
|
||||
|
||||
TEST(FormatterTest, CustomFormat) {
|
||||
|
@ -206,8 +206,8 @@ void CheckThrowError(int error_code, FormatErrorMessage format,
|
||||
TEST(UtilTest, FormatSystemErrorMessage) {
|
||||
fmt::Writer message;
|
||||
fmt::internal::FormatSystemErrorMessage(message, EDOM, "test");
|
||||
EXPECT_EQ(str(fmt::Format("test: {}")
|
||||
<< GetSystemErrorMessage(EDOM)), fmt::str(message));
|
||||
EXPECT_EQ(str(fmt::format("test: {}",
|
||||
GetSystemErrorMessage(EDOM))), fmt::str(message));
|
||||
}
|
||||
|
||||
TEST(UtilTest, SystemErrorSink) {
|
||||
@ -240,7 +240,7 @@ TEST(UtilTest, FormatWinErrorMessage) {
|
||||
fmt::Writer actual_message;
|
||||
fmt::internal::FormatWinErrorMessage(
|
||||
actual_message, ERROR_FILE_EXISTS, "test");
|
||||
EXPECT_EQ(str(fmt::Format("test: {}") << fmt::str(utf8_message)),
|
||||
EXPECT_EQ(str(fmt::format("test: {}", fmt::str(utf8_message))),
|
||||
fmt::str(actual_message));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user