search: add tests for "case:" in TestSearchRepositories
Created by: keegancsmith
This PR first refactors TestSearchRepositories to be data driven. This leads to making it much easier to add tests and see what exactly they are testing.
Best reviewed commit by commit. Extraction of getPatternInfo happened in #7807
Follow-up from #7724.