• Abseil Team's avatar
    Googletest export · 0c400f67
    Abseil Team authored
    GMock: Make Truly explain when it fails
    
    I just wrote a test that had a matcher of the form
      Optional(AllOf(
        SomeMatcher,
        SomeOtherMatcher,
        Truly(SomePredicate)))
    
    The predicate failed, the other two matchers succeeded, and I got a hard-to-interpret message saying that the value in the optional "didn't match". Didn't match what?
    
    This change improves situations like that slightly by having Truly explain to its result listener when it fails. When there are multiple Trulys in an AllOf, there will be some ambiguity, but it will at least provide more information than right now.
    
    PiperOrigin-RevId: 341105141
    0c400f67
gmock-matchers_test.cc 274 KB