grep tests could be easier to extend
The grep test suite is a little challenging to work with right now. In particular, it's designed so that there are multiple phases of tests. However, the set of output file names is used across all phases. Adding an additional test an earlier phase would mean renaming everything. Instead, we should just make these phases a part of the script. In addition there are a bunch of other small things that could be improved about the test suite:
- Adding new phases shouldn't require duplicating the same bulk of logic every time
- It could run all tests to completion, rather than stopping at the first failure.
- It could actually tests non-zero cases
- The temporary ends up trying to be in the same directory as the tests, when it could just be in /tmp.
- When something is different or there's a missing output file, it could tell you the name of the file it expected