We walk through both of the expect and actual objects,
creating a Same node for each field in common, based on
their similarity:
true (they're a match) omit from the result (the child node is discarded)
false (they're simply nonmatching) format both expect and object
COMPLEX - walk through child nodes
if match: child node is discarded
else, child node is retained (along with its non-matching children)
We 'discard' by just having the print method return ''
When walking child nodes, we use the shouldCompare(key) method to determine
whether to check a given field. In this class, this is always true (because
we are testing for full deep sameness), but in tcompare!has.Has and
subclasses, it's more complicated (only test nodes that exist in the expect
object).
Base class for all comparators
We walk through both of the expect and actual objects, creating a Same node for each field in common, based on their similarity:
We 'discard' by just having the print method return ''
When walking child nodes, we use the shouldCompare(key) method to determine whether to check a given field. In this class, this is always true (because we are testing for full deep sameness), but in tcompare!has.Has and subclasses, it's more complicated (only test nodes that exist in the expect object).