mirror of
https://github.com/google/googletest.git
synced 2025-12-06 08:46:50 +08:00
Merge 1ffb761664edc0c696b636e18582fe4d25616d01 into 1b96fa13f549387b7549cc89e1a785cf143a1a50
This commit is contained in:
commit
f93d9624df
@ -79,6 +79,11 @@ class IsEmptyMatcher {
|
||||
return MatchAndExplain(std::string(s), listener);
|
||||
}
|
||||
|
||||
// Matches C-style wide strings.
|
||||
bool MatchAndExplain(const wchar_t* s, MatchResultListener* listener) const {
|
||||
return MatchAndExplain(std::wstring(s), listener);
|
||||
}
|
||||
|
||||
// Describes what this matcher matches.
|
||||
void DescribeTo(std::ostream* os) const { *os << "is empty"; }
|
||||
|
||||
|
||||
@ -1093,6 +1093,14 @@ TEST(IsEmptyTest, MatchesCString) {
|
||||
EXPECT_FALSE(m.Matches(b));
|
||||
}
|
||||
|
||||
TEST(IsEmptyTest, MatchesCWideString) {
|
||||
const Matcher<const wchar_t*> m = IsEmpty();
|
||||
const wchar_t a[] = L"";
|
||||
const wchar_t b[] = L"x";
|
||||
EXPECT_TRUE(m.Matches(a));
|
||||
EXPECT_FALSE(m.Matches(b));
|
||||
}
|
||||
|
||||
// Tests that IsNull() matches any NULL pointer of any type.
|
||||
TEST(IsNullTest, MatchesNullPointer) {
|
||||
Matcher<int*> m1 = IsNull();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user