• Eric Myhre's avatar
    New testcase system for exercising typed nodes; Revamp struct tests with it. · 5d732d47
    Eric Myhre authored
    This new system focuses on table-driven tests, and leans heavily upon
    json as a shorthand for expressing fixtures.
    
    It also makes a great deal more effort to exercise the different
    features of nodes (and their paired representation nodes) from all
    directions at once for each test datum, rather than requring that all
    be written out manually.
    
    The result is that the struct tests we've renovated have a lovely
    diffstat shrinkage: 111 insertions, 299 deletions...
    
    And yet the smaller line count results in *more* coverage.
    
    (Okay, the linecount increase for the testcase structure and helper
    methods is much bigger than the savings in fixture size... but,
    only *so far*.  I assume this will continue to pay off in the future.)
    
    Relatedly: a bug in struct map representations has been fixed.
    (It was the sibling of 5f589653, embarassingly.)  Thank goodness we now
    get proper coverage of this area.
    
    There's a few TODOs left to further expand the exercises, but those
    can slot in easily in subsequent commits.  Same goes for further
    expansion of usage of this new system.
    5d732d47
testStructsContainingMaybe_test.go 5.02 KB