From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86731 invoked by alias); 11 Nov 2018 16:52:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 86721 invoked by uid 89); 11 Nov 2018 16:52:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Marchi, simon, Simon, marchi X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 11 Nov 2018 16:52:15 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id wABGq852018843 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 11 Nov 2018 11:52:13 -0500 Received: by simark.ca (Postfix, from userid 112) id E9FE61E74C; Sun, 11 Nov 2018 11:52:07 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id E68061E52D; Sun, 11 Nov 2018 11:52:06 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 11 Nov 2018 16:52:00 -0000 From: Simon Marchi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Add completer for skip numbers In-Reply-To: <59fef7d2-7413-6039-88d9-da883ebaa139@redhat.com> References: <20181110173941.26165-1-simon.marchi@polymtl.ca> <59fef7d2-7413-6039-88d9-da883ebaa139@redhat.com> Message-ID: <6a37c9a7c3cbf9cc991038df138ee6bc@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00203.txt.bz2 On 2018-11-10 14:07, Pedro Alves wrote: > On 11/10/2018 05:39 PM, Simon Marchi wrote: >> Add completer to various commands that accept skip numbers: >> >> - skip enable >> - skip disable >> - skip delete >> - info skip >> >> These commands also accept ranges, but I am not too sure of how to do >> that properly, so I went for the simpler goal of complete just >> numbers. >> >> A future idea would be to make a re-usable and well-tested completer >> for >> numbers and ranges. I think it could at least be re-used for >> breakpoint >> numbers (for example with the "enable breakpoints" command). > > And threads. Right. > Please use the lib/completion-support.exp routines > for testing this. Those exercise both the complete command > and actual TAB completion. Above you want to use > test_gdb_complete_multiple. > > You should also add: > > - a test that exercises unique completions like "skip delete 12", > with test_gdb_complete_unique. > > - a test that exercises no completions at all, like "skip delete 2", > with test_gdb_complete_none. > > - some test like "skip delete a1" to make sure we don't > mistakenly complete that a1 into a1/a10/a11/a12. > > As for a range completer, doesn't e.g., "skip delete 1-2" already > try to complete the "2", and "skip delete 1-" present all the numbers? > I'd think so, given that '-' is part of the default word break chars > set (default_word_break_characters). You should add tests for that > too, > IMO, since people will very naturally use it. Even if not super smart > (e.g. 2-[TAB] ideally wouldn't present "1"), it's still useful as is. Thanks for all the feedback, I hope I have addressed everything in v2. Simon