From patchwork Thu Jun 27 19:14:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 33461 Received: (qmail 85854 invoked by alias); 27 Jun 2019 19:14:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 85753 invoked by uid 89); 27 Jun 2019 19:14:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1667 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jun 2019 19:14:33 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4FEF33098558 for ; Thu, 27 Jun 2019 19:14:32 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF344600CC for ; Thu, 27 Jun 2019 19:14:31 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 4/5] Fix latent bug in test_gdb_complete_cmd_multiple Date: Thu, 27 Jun 2019 20:14:26 +0100 Message-Id: <20190627191427.20742-5-palves@redhat.com> In-Reply-To: <20190627191427.20742-1-palves@redhat.com> References: <20190627191427.20742-1-palves@redhat.com> A following patch will add the following to a testcase: test_gdb_completion_offers_commands "| " And that tripped on a latent testsuite bug: (gdb) | PASS: gdb.base/shell.exp: tab complete "| " ^CQuit (gdb) complete | | ! | + PASS: gdb.base/shell.exp: cmd complete "| " | *** List may be truncated, max-completions reached. *** (gdb) FAIL: gdb.base/shell.exp: set max-completions 200 set max-completions 200 The issue is that "|" ends up as part of a regexp, and "|" in regexps has a special meaning... Fix this with string_to_regexp. gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves * lib/completion-support.exp (test_gdb_complete_cmd_multiple): Use string_to_regexp. --- gdb/testsuite/lib/completion-support.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp index 3199e85fd4d..abe48b4a7f7 100644 --- a/gdb/testsuite/lib/completion-support.exp +++ b/gdb/testsuite/lib/completion-support.exp @@ -200,8 +200,9 @@ proc test_gdb_complete_cmd_multiple { cmd_prefix completion_word completion_list set expected_re [make_cmd_completion_list_re $cmd_prefix $completion_list $start_quote_char $end_quote_char] if {$max_completions} { + set cmd_prefix_re [string_to_regexp $cmd_prefix] append expected_re \ - "$cmd_prefix \\*\\*\\* List may be truncated, max-completions reached\\. \\*\\*\\*.*\r\n" + "$cmd_prefix_re \\*\\*\\* List may be truncated, max-completions reached\\. \\*\\*\\*.*\r\n" } set cmd_re [string_to_regexp "complete $cmd_prefix$completion_word"]