On Tue, 2024-03-12 at 18:53 +0100, Alvaro Herrera wrote: > I suggest that pg_dump/t/002_pg_dump.pl could use a verification that > the ->{regexp} thing is not empty.
I'm not sure how exactly to test for an empty pattern. The problem is, we don't really want to test for an empty pattern, because /(?^:)/ is fine. The problem is //, which gets turned into an actual pattern (perhaps empty or perhaps not), and by the time it's in the %tests hash, I think it's too late to distinguish. Again, I'm not a perl expert, so suggestions welcome. > I also tried grepping (for things > like qr{}, qr[], qr||, qr!!) and didn't find anything beyond what you > have ... but I only looked for the "qr" literal, not other ways to > get > regexes. I think that's fine. qr// seems the most dangerous, because it seems to behave differently in different versions of perl. Grepping for regexes in perl code is an "interesting" exercise. Regards, Jeff Davis