From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10965 invoked by alias); 9 Apr 2003 20:14:10 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10941 invoked from network); 9 Apr 2003 20:14:09 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 9 Apr 2003 20:14:09 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h39KE8e31276 for ; Wed, 9 Apr 2003 16:14:08 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h39KE8J17845 for ; Wed, 9 Apr 2003 16:14:08 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h39KE7m06560 for ; Wed, 9 Apr 2003 16:14:07 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id B5E632C43F; Wed, 9 Apr 2003 16:18:26 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16020.32786.577583.70826@localhost.redhat.com> Date: Wed, 09 Apr 2003 20:14:00 -0000 To: David Carlton Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC/TESTSUITE] completion.exp In-Reply-To: References: <16019.23357.144916.774165@localhost.redhat.com> X-SW-Source: 2003-04/txt/msg00169.txt.bz2 David Carlton writes: > On Tue, 8 Apr 2003 19:29:01 -0400, Elena Zannoni said: > > > +# If the directory name contains a '+' we must escape it, adding a backslash. > > +# If not, the test below will fail because it will interpret the '+' as a > > +# regext operator. > > +regsub -all \\+ ${fullsrcdir} \\\+ dirstring > > Would it be better to use string_to_regexp instead of regsub? (But > leaving in the comment as an indication of why you're using it.) > Ah, I didn't know about string_to_regexp. Yes, definitely, thank you. How's this? elena Index: completion.exp =================================================================== RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/completion.exp,v retrieving revision 1.14 diff -u -p -r1.14 completion.exp --- completion.exp 4 Jan 2003 22:37:49 -0000 1.14 +++ completion.exp 9 Apr 2003 20:11:44 -0000 @@ -669,7 +669,14 @@ cd ${srcdir} set fullsrcdir [pwd] cd ${mydir} -gdb_test "cd ${fullsrcdir}" "Working directory ${fullsrcdir}.*" "cd to \${srcdir}" +# If the directory name contains a '+' we must escape it, adding a backslash. +# If not, the test below will fail because it will interpret the '+' as a +# regexp operator. We use string_to_regexp for this purpose. + +gdb_test "cd ${fullsrcdir}" \ + "Working directory [string_to_regexp ${fullsrcdir}].*" \ + "cd to \${srcdir}" + send_gdb "file ./gdb.base/compl\t" sleep 1 gdb_expect {