Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: mojo/public/cpp/bindings/tests/string_unittest.cc

Issue 1532993002: Add output formatters for more mojom types. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-9
Patch Set: move tests, change map formatting Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/string_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/string_unittest.cc b/mojo/public/cpp/bindings/tests/string_unittest.cc
index 0769071b15de760fae1b2d11b33fa4b76d2bf754..4089039bda38e849a76d63d473b8498957d28ac9 100644
--- a/mojo/public/cpp/bindings/tests/string_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/string_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <sstream>
+
#include "mojo/public/cpp/bindings/string.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -116,5 +118,14 @@ TEST(StringTest, LessThanNullness) {
EXPECT_FALSE(real < null);
}
+TEST(StringTest, OutputFormatting) {
+ String s("abc");
+ String null;
+
+ std::ostringstream so;
+ so << "s=" << s << ", null=" << null;
+ EXPECT_EQ("s=abc, null=", so.str());
+}
+
} // namespace test
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698