[Bash-completion-devel] scp remote path completion broken?
Freddy Vulto
fvulto at gmail.com
Sun Sep 6 22:42:34 UTC 2009
On Sun, Sep 6, 2009 at 5:27 PM, Ville Skyttä<ville.skytta at iki.fi> wrote:
> If nobody can remember/decipher exactly what the problematic commit was
> supposed to fix, I suggest we just revert it and see what breaks.
+1, committed e663e1c
`_get_cword' is reverted to before commit f6497298. This fixes test 8
(see below), notably by restoring passing an argument to _get_cword to
omit characters from $COMP_WORDBREAKS.
At the end of `get_cword', `echo "$cur"' has been changed to `printf
"%s" "$cur"'. This fixes test 9 (see below).
Let's do some heavy testing (add more unit tests?) on _get_cword
before releasing bash-completion-1.0-4.
I've added unit tests for _get_cword (| = cursor position):
1. a b| should return b
2. a | should return nothing
3. a b|c should return b
4. a b\ c| should return b\ c
5. a 'b c| should return 'b c
6. a "b c| should return "b c
7. a b:c| should return c
8. a b:c| with WORDBREAKS -= : should return b:c
9. a -n| should return -n
Tests 5 & 6 yield "expected failures", see bugreport:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474094 . At a first glance
this bugreport contains useful ideas, so anyone willing to try to make tests 5 &
6 pass, be sure to have a look there first.
To run the automated tests:
$ cd test && ./runUnit _get_cword.exp
This is what my test/log/unit.sum looks after having given the command above:
$ cat log/unit.sum
Test Run By freddy on Mon Sep 7 00:07:34 2009
Native configuration is i686-pc-linux-gnu
=== unit tests ===
Schedule of variations:
unix
Running target unix
Running ./unit/_get_cword.exp ...
PASS: a b| should return b
PASS: a | should return nothing
PASS: a b|c should return b
PASS: a b\ c| should return b\ c
XFAIL: a 'b c| should return 'b c
XFAIL: a "b c| should return "b c
PASS: a b:c| should return c
PASS: a b:c| with WORDBREAKS -= : should return b:c
PASS: a -n| should return -n
PASS: Environment should not be modified
=== unit Summary ===
# of expected passes 8
# of expected failures 2
Regards,
Freddy Vulto
http://fvue.nl
More information about the Bash-completion-devel
mailing list