tests: move test_cmp_rev to test-lib-functions