Go testsuite patch committed: Don't quote quoted parentheses

Ian Lance Taylor iant@golang.org
Mon Dec 7 17:36:42 GMT 2020


This patch fixes go-test.exp to not backslash quote parentheses that
are already backslash quoted.  This regexp quoting isn't fully
general, it just has to handle the cases that arise in the testsuite.
This change fixes a case in a new test, not yet committed.  (It would
be nice to have a general fix if anybody has one).  Bootstrapped and
ran Go testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian

* go.test/go-test.exp (errchk): Don't backslash quote parentheses
that are already backslash quoted.
-------------- next part --------------
diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp
index 8f17cb3db71..d129e1c65da 100644
--- a/gcc/testsuite/go.test/go-test.exp
+++ b/gcc/testsuite/go.test/go-test.exp
@@ -131,11 +131,11 @@ proc errchk { test opts } {
 	    set index [string first "dg-error" $out_line]
 	    regsub -start $index -all "\(\[^\\\\]\)\}\(.\)" $out_line "\\1\\\\\[\\\}\\\\\]\\2" out_line
 	}
-	if [string match "*dg-error*\(*" $out_line] {
+	if [string match "*dg-error*\\\[^\\\\\]\(*" $out_line] {
 	    set index [string first "dg-error" $out_line]
 	    regsub -start $index -all "\\\\\\\(" $out_line "\\\\\[\\\(\\\\\]" out_line
 	}
-	if [string match "*dg-error*\)*\}" $out_line] {
+	if [string match "*dg-error*\\\[^\\\\\]\)*\}" $out_line] {
 	    set index [string first "dg-error" $out_line]
 	    regsub -start $index -all "\\\\\\\)\(.\)" $out_line "\\\\\[\\\)\\\\\]\\1" out_line
 	}


More information about the Gcc-patches mailing list