[Testing/Support] Make matchers work with Expected<T&>
ClosedPublic

Authored by labath on Wed, Dec 6, 8:41 AM.

Details

Summary

This did not work because the ExpectedHolder was trying to hold the
value in an Optional<T*>. Instead of trying to mimic the behavior of
Expected and try to make ExpectedHolder work with references and
non-references, I simply store the reference to the Expected object in
the holder.

I also add a bunch of tests for these matchers, which have helped me
flesh out some problems in my initial implementation of this patch, and
uncovered the fact that we are not consistent in quoting our values in
the matcher output (which I also fix).

Diff Detail

Repository
rL LLVM
labath created this revision.Wed, Dec 6, 8:41 AM
zturner accepted this revision.Wed, Dec 6, 8:56 AM
This revision is now accepted and ready to land.Wed, Dec 6, 8:56 AM
This revision was automatically updated to reflect the committed changes.