Add a selftest that checks documentation invariants.