TESTS: minor refactor to print-test.r