This is an archive of the discontinued LLVM Phabricator instance.

[Support/Path] Add more tests and improve failure messages of existing ones
ClosedPublic

Authored by labath on Apr 23 2018, 2:48 AM.

Details

Summary

I am preparing a patch to the path function. While working on it, I
noticed that some of the areas are lacking test coverage (e.g. filename
and parent_path functions), so I add more tests to guard against
regressions there.

I have also found the failure messages hard to understand, so I rewrote
some existing test to give more actionable messages when they fail:

  • for tests which run over multiple inputs, I use SCOPED_TRACE, to show which of the inputs caused the actual failure.
  • for comparisons of vectors, I use gmock's container matchers, which will print out the full container contents (and the elements that differ) when they fail to match.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Apr 23 2018, 2:48 AM
zturner accepted this revision.Apr 23 2018, 9:12 AM

LGTM, thanks for adding new tests!

This revision is now accepted and ready to land.Apr 23 2018, 9:12 AM
This revision was automatically updated to reflect the committed changes.