From c3f5dce8d5461c24c377eeb8b74fab2a556f382a Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 28 Jan 2014 12:49:36 -0800 Subject: [PATCH] Fixed bug https://github.com/vitaut/format/issues/16 . Thanks to https://github.com/fil222 ! --- format-test.cc | 4 ++++ format.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/format-test.cc b/format-test.cc index 32c00351..947cd69a 100644 --- a/format-test.cc +++ b/format-test.cc @@ -1022,6 +1022,10 @@ void CheckUnknownTypes( } } +TEST(FormatterTest, FormatBool) { + EXPECT_EQ(L"1", str(Format(L"{}") << true)); +} + TEST(FormatterTest, FormatShort) { short s = 42; EXPECT_EQ("42", str(Format("{0:d}") << s)); diff --git a/format.h b/format.h index 4e505089..03661d2e 100644 --- a/format.h +++ b/format.h @@ -760,7 +760,7 @@ class BasicWriter { return *this; } - void Write(const std::basic_string &s, const FormatSpec &spec) { + void Write(const std::basic_string &s, const FormatSpec &spec) { FormatString(s.data(), s.size(), spec); }