Page MenuHomePhabricator

[FileCheck] Make Match unittest more flexible
ClosedPublic

Authored by thopre on Jan 17 2020, 3:51 AM.

Details

Summary

FileCheck's Match unittest needs updating whenever some call to
initNextPattern() is inserted before its final block of checks. This
commit change usage of LineNumber inside the Tester object so that the
line number of the current pattern can be queries, thereby making the
Match test more solid.

Event Timeline

thopre created this revision.Jan 17 2020, 3:51 AM
jhenderson added inline comments.Jan 20 2020, 12:59 AM
llvm/unittests/Support/FileCheckTest.cpp
426–427

To make it clear that @LINE has been updated here, I'd recommend changing this phrase to "Check that @LINE matches the later line number." It might also be worthwhile putting a comment somewhere showing that initNextPattern updates the line number.

thopre updated this revision to Diff 239096.Jan 20 2020, 5:49 AM
thopre marked an inline comment as done.

Address review comments

This revision is now accepted and ready to land.Jan 20 2020, 6:14 AM
This revision was automatically updated to reflect the committed changes.