Fix EXPECT_THAT() to support literal strings as a second argument.

This commit is contained in:
kosak
2015-04-28 23:06:58 +00:00
parent 6305ff5a92
commit 9b1a944ec4
2 changed files with 19 additions and 3 deletions

View File

@@ -762,6 +762,21 @@ TEST(SafeMatcherCastTest, ValueIsNotCopied) {
EXPECT_TRUE(m.Matches(n));
}
TEST(ExpectThat, TakesLiterals) {
EXPECT_THAT(1, 1);
EXPECT_THAT(1.0, 1.0);
EXPECT_THAT(string(), "");
}
TEST(ExpectThat, TakesFunctions) {
struct Helper {
static void Func() {}
};
void (*func)() = Helper::Func;
EXPECT_THAT(func, Helper::Func);
EXPECT_THAT(func, &Helper::Func);
}
// Tests that A<T>() matches any value of type T.
TEST(ATest, MatchesAnyValue) {
// Tests a matcher for a value type.