From: Jarkko Hietaniemi Date: Sat, 17 Oct 1998 14:59:15 +0000 (+0000) Subject: More robust yacc/bison failure output handling. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d91e2bdb4bc210a23427760819d26aa7951da955;p=p5sagit%2Fp5-mst-13.2.git More robust yacc/bison failure output handling. p4raw-id: //depot/cfgperl@2011 --- diff --git a/t/comp/require.t b/t/comp/require.t index 4120bb1..1959326 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 667db98..b924f89 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 680564f..58b53ae 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//) {