This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
re/anyof.t: Add debugging info
authorKarl Williamson <khw@cpan.org>
Wed, 23 Mar 2022 19:26:26 +0000 (13:26 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 23 Mar 2022 19:46:53 +0000 (13:46 -0600)
This is in response to
https://github.com/Perl/perl5/pull/19558#issuecomment-1076659884

t/re/anyof.t

index 6cc34ef..8ce5cdc 100644 (file)
@@ -75,6 +75,10 @@ sub  get_compiled ($) {
     }
 
     $_ = shift @lines;
+    unless (defined $_) {
+        die "Unexpected compilation result: '$result'\n"
+          . " Compiled from '$actual_pattern'";
+    }
 
     s/ \s* \( \d+ \) \s* //x;   # Get rid of the node branch
     s/ ^ \s* \d+ : \s* //x;     # ... And the node number