Extensive unit tests for DiffNodes, Diffelements, and DiffLeafs data structure. The lack of unity in these three data structures is a bit gross, to be honest, but it might may not be a significant factor when I reach implementing the generic diff functions. The problem is that ideally these would look like the scheme structures:
(A B (C D E)) which is a nested list containing A and B items and a sublist of C D E. Here there are only two classes: lists and everything else. Right now we have three. DiffNodes, which contain both atomic fields (A B) as well as the subnodes ((C D E)) here. These a specific class for DiffLeaf, which is really just a pair mapping name=value. And DiffElement contains a named item, since all objected in the hierarchy have a name. It's just doesn't feel right to me right now. Ultimately the problem is that you want the objects to be self-describing, so the DiffElement and DiffLeaf are a clean factoring the need for names in both the values and the nodes.
This commit is contained in:
parent
38740b0ff5
commit
527fbeaf3c