Formalize testing of diff parsing objects.
Review Request #12064 — Created Feb. 19, 2022 and submitted
We have a lot of unit tests that test the results of diff parsing, and
they all do it slightly differently. Some assume the number of resulting
ParsedDiffFileobjects. Some fail to test certain state. Most just
haven't been updated as new attributes have been added. Most that are
more comprehensive ideally wouldn't be, since it's hard to tell what
state they're explicitly checking for and what are considered defaults.
There are some updates coming to diff parsing for DiffX and for some
in-progress SCM implementations, such as symlink target storage. To
prepare for that, this change goes through and formalizes how we test
class provides some assertions for these objects:
These take in attributes to check on the objects. Default values are
checked if not explicitly provided.
All relevant unit tests now use these methods, ensuring parsing changes
or state updates don't regress anything or get missed going forward.
All unit tests passed.