diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1998-10-17 14:59:15 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1998-10-17 14:59:15 +0000 |
commit | d91e2bdb4bc210a23427760819d26aa7951da955 (patch) | |
tree | 594f535487f28b45619e586477266c771dee959b | |
parent | 33e3389819aa99d8aa0fbaa625ec3ae648f95a4f (diff) | |
download | perl-d91e2bdb4bc210a23427760819d26aa7951da955.tar.gz |
More robust yacc/bison failure output handling.
p4raw-id: //depot/cfgperl@2011
-rwxr-xr-x | t/comp/require.t | 4 | ||||
-rwxr-xr-x | t/op/misc.t | 4 | ||||
-rwxr-xr-x | t/pragma/subs.t | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/t/comp/require.t b/t/comp/require.t index 4120bb1ea5..1959326281 100755 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -35,7 +35,9 @@ print "ok ",$i++,"\n"; # compile-time failure in require do_require "1)\n"; -print "# $@\nnot " unless $@ =~ /syntax error/i; +# bison says 'parser error' instead of 'syntax error', +# various yaccs may or may not capitalize 'syntax'. +print "# $@\nnot " unless $@ =~ /(syntax|parser) error/i; print "ok ",$i++,"\n"; # successful require diff --git a/t/op/misc.t b/t/op/misc.t index 667db989bf..b924f89847 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -36,7 +36,9 @@ for (@prgs){ $status = $?; $results = `$CAT $tmpfile`; $results =~ s/\n+$//; - $results =~ s/syntax error/syntax error/i; +# bison says 'parser error' instead of 'syntax error', +# various yaccs may or may not capitalize 'syntax'. + $results =~ s/^(syntax|parser) error/\L$1 error/i; $expected =~ s/\n+$//; if ( $results ne $expected){ print STDERR "PROG: $switch\n$prog\n"; diff --git a/t/pragma/subs.t b/t/pragma/subs.t index 680564f843..58b53ae293 100755 --- a/t/pragma/subs.t +++ b/t/pragma/subs.t @@ -55,7 +55,9 @@ for (@prgs){ # allow expected output to be written as if $prog is on STDIN $results =~ s/tmp\d+/-/g; $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg - $results =~ s/Syntax/syntax/; # non-standard yacc +# bison says 'parser error' instead of 'syntax error', +# various yaccs may or may not capitalize 'syntax'. + $results =~ s/^(syntax|parser) error/\L$1 error/i; $expected =~ s/\n+$//; my $prefix = ($results =~ s/^PREFIX\n//) ; if ( $results =~ s/^SKIPPED\n//) { |