Testing icgrep colorization
The QA/greptest.py performs combinatorial testing of icgrep with the possibility of adding various random flags. In particular it has a mode for testing the -colors=always flag.
Unfortunately, the testing of the result of adding colorization is incomplete. The oracle in the program understands how to strip out colorization escape sequences and then compare with the expected search results. This does not confirm that the colorization itself is correct, i.e., that the portion of the output that is colorized actually includes the characters that are matched.
The program should be updated to support complete colorization tests. In order to do this, the
grepcase data in the greptest.xml files would need an additional attribute to indicate
the spans of characters that should be matched on each line.
- Design an optional attribute that can be added to grepcases to indicate the span of characters that should be colorized on each line.
- Update the greptest.xml file to include this colorization data for some grepcases.
- Modify the greptest.py program to check whether the correct spans of characters are colorized.
One note: icgrep colorization is based on the idea that all possible matches on each line should be colorized. Sometimes there will be multiple overlapping matches on a line.