I think that developping a test would be much simpler with the improved tap test infrastructure, so I would suggest to wait to know the result of the corresponding patch.
Also, could you recod the patch to CF 2017-09?https://commitfest.postgresql.org/14/
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных