I didn't add such a test because there are already several cases (in foreign_data.sql, IIRC) that trigger the assert, which is how come I found the problem in the first place. Admittedly, those depend on potentially-changeable details of an information_schema view, so maybe it'd be better to have a bespoke test.
I recently had a situation where having a bespoke test would have been helpful. Attached is a mostly-verbatim formalization of the tests from the original email. Q3 was of particular use to me.