This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by labath on Dec 6 2017, 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

Event Timeline

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.