This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Martin Galvan <martin dot galvan at tallertechnologies dot com>
- Cc: gdb-patches at sourceware dot org, qiyaoltc at gmail dot com, dje at google dot com
- Date: Sun, 28 Jun 2015 11:07:00 +0200
- Subject: Re: [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
- Authentication-results: sourceware.org; auth=none
- References: <1435464030-22372-1-git-send-email-martin dot galvan at tallertechnologies dot com>
Martin Galvan <martin.galvan@tallertechnologies.com> writes:
> +# Notice that the '[' and ']' characters don't need to be escaped for strings
> +# wrapped in {} braces.
This isn't true in general, it's because this is a tcl list. The
backslashes are removed when the list is passed through join in
help_test_raw (which removes one level of quoting, but doesn't do
command or variable expansion). But that also means that the backslash
before '.' is ineffective and should be replaced by a double backslash.
Alternatively, each element could be enclosed with braces which disables
any quoting inside it.
> proc test_class_help { command_class expected_initial_lines args } {
> set l_stock_body {
> - "List of commands\:.*\[\r\n\]+"
> - "Type \"help\" followed by command name for full documentation\.\[\r\n\]+"
> - "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n\]+"
> + "List of commands\:.*[\r\n]+"
The backslash before ':' is useless.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."