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

Unified Diff: ui/gfx/range/range_unittest.cc

Issue 1948283002: Fix gfx::Range::ToString() to use the correct format specifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add sstream header. Created 4 years, 7 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
« no previous file with comments | « ui/gfx/range/range.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/range/range_unittest.cc
diff --git a/ui/gfx/range/range_unittest.cc b/ui/gfx/range/range_unittest.cc
index 71a81649ab52d3276d0d0a4358110224f5d5b64a..4ae7a67c4f1b97b690968e2af9f4e4049472bfe5 100644
--- a/ui/gfx/range/range_unittest.cc
+++ b/ui/gfx/range/range_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 "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/range/range.h"
#include "ui/gfx/range/range_f.h"
@@ -252,3 +254,13 @@ TEST(RangeTest, RangeFConverterTest) {
EXPECT_EQ(0U, range.start());
EXPECT_EQ(0U, range.end());
}
+
+TEST(RangeTest, ToString) {
+ gfx::Range range(4, 7);
+ EXPECT_EQ("{4,7}", range.ToString());
+
+ range = gfx::Range::InvalidRange();
+ std::ostringstream expected;
+ expected << "{" << range.start() << "," << range.end() << "}";
+ EXPECT_EQ(expected.str(), range.ToString());
+}
« no previous file with comments | « ui/gfx/range/range.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698