Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f643f7

Browse files
Abseil Teamcopybara-github
Abseil Team
authored andcommitted
Make SizeIsMatcher::Impl conform to the contract of MatcherDescriberInterface.
MatcherDescriberInterface specifies that DescribeTo "should print a verb phrase", but "size ..." is not a verb phrase. Currently, ElementsAre(SizeIs(9)) is described as "has 1 element that size is equal to 9". With this change, it will be described as "has 1 element that has a size that is equal to 9".PiperOrigin-RevId: 492022324Change-Id: I4083335f2419462464957521c1e033643b53b763
1 parenta16bfcf commit1f643f7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎googlemock/include/gmock/gmock-matchers.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,11 +2309,11 @@ class SizeIsMatcher {
23092309
: size_matcher_(MatcherCast<SizeType>(size_matcher)) {}
23102310

23112311
voidDescribeTo(::std::ostream* os)constoverride {
2312-
*os <<"size";
2312+
*os <<"has asize that";
23132313
size_matcher_.DescribeTo(os);
23142314
}
23152315
voidDescribeNegationTo(::std::ostream* os)constoverride {
2316-
*os <<"size";
2316+
*os <<"has asize that";
23172317
size_matcher_.DescribeNegationTo(os);
23182318
}
23192319

‎googlemock/test/gmock-matchers-containers_test.cc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,8 +1182,8 @@ TEST(SizeIsTest, WorksWithMinimalistCustomType) {
11821182

11831183
TEST(SizeIsTest, CanDescribeSelf) {
11841184
Matcher<vector<int>> m =SizeIs(2);
1185-
EXPECT_EQ("size is equal to 2",Describe(m));
1186-
EXPECT_EQ("size isn't equal to 2",DescribeNegation(m));
1185+
EXPECT_EQ("has asize that is equal to 2",Describe(m));
1186+
EXPECT_EQ("has asize that isn't equal to 2",DescribeNegation(m));
11871187
}
11881188

11891189
TEST(SizeIsTest, ExplainsResult) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp