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.
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<tab>" 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.