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

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



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

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