This updated version works for me and addresses previous comments.
I think that such tests are definitely valuable, especially as many corner
cases which must trigger errors are covered.
I recommend to apply it.
> Please find an updated patch as per comments on Commitfest (comments
> replicated below for ease of understanding).
>
> Feedback 1:
> fc: role_ro2/3 used twice?
> rt: Corrected in this update.
>
> Feedback 2:
> fc: I do not understand why "asdf" conveys anything about an expected
> failure. Association of Scientists, Developers and Faculties? :-)
> rt: ASDF is a pattern that I learnt in one of the tests (SEQUENCE?) that
> pre-existed when I started working. Its a slang for arbit text that I just
> reused thinking that it is normal practice here. Anyway, have corrected
> that in this update.
>
> Feedback 3:
> fc: 2030/1/1 -> 2030-01-01? maybe use a larger date?
> rt: 2030/1/1 date is not a failure point of the test. It needs to be a
> valid date (but sufficiently distant that so that tests don't fail). I
> tried setting this to 2200/1/1 and I get the same error message. Let me
> know if this still needs to be a large date.
> fb: VALID UNTIL '9999-12-31' works for me...
> rt: I thought 20 years is a date sufficiently far ahead to ensure that this
> test doesn't fail. Sure, have updated the test to use 9999/1/1. Also, have
> added more tests at the end to ensure date-checks are also being validated
> in ALTER ROLE VALID UNTIL.
--
Fabien.