tests: refactor mechanics of testing in a sub test-lib