From: Elena Zannoni <ezannoni@redhat.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/TESTSUITE] completion.exp
Date: Wed, 09 Apr 2003 20:14:00 -0000 [thread overview]
Message-ID: <16020.32786.577583.70826@localhost.redhat.com> (raw)
In-Reply-To: <ro11y0binzw.fsf@jackfruit.Stanford.EDU>
David Carlton writes:
> On Tue, 8 Apr 2003 19:29:01 -0400, Elena Zannoni <ezannoni@redhat.com> 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 {
next prev parent reply other threads:[~2003-04-09 20:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-08 23:24 Elena Zannoni
2003-04-09 17:23 ` David Carlton
2003-04-09 20:14 ` Elena Zannoni [this message]
2003-04-09 20:35 ` David Carlton
2003-04-09 20:57 ` Daniel Jacobowitz
2003-04-10 13:38 ` Elena Zannoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16020.32786.577583.70826@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=carlton@math.stanford.edu \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox