I've re-written the set of tests as suggested (I hope!). I've not
re-run the coverage report (yet) to ensure we're at least as well
covered as v3, but attached is v4 for your inspection (amusement?).
I've tried to author the SQL tests such that failures clearly indicate
what's at gone wrong.
This exercise turned into a lot more LOC than I'd expected, I hope it
provides some value to the community for testing this important data
structure and helps to codify the API clearly.
best.
-greg