[Bash-completion-devel] automated testing: help with assert_complete_* please

Peter Cordes peter at cordes.ca
Fri Dec 12 22:05:39 UTC 2014


On Fri, Dec 12, 2014 at 05:54:37PM -0400, Peter Cordes wrote:
> 
> # FAIL: slightly different results here
> assert_complete_one {boost-defaults} "apt-get source    boost-def"
> sync_after_int

 Ok, so apparently extra whitespace is a problem?
#PASS:
assert_complete_one {boost-defaults} "apt-get source boost-def"
sync_after_int


 I had been using extra spaces inside the command to complete,
to make it line up nicely:

assert_no_complete                   "apt-get changelog boost-def"
sync_after_int

assert_complete_one {boost-defaults} "apt-get source    boost-def"
sync_after_int


 This doesn't solve the ada-ref -> ada-reference-manual*
completions not working, but I was going to leave those out anyway, in
favour of using boost-defaults as a source package name that isn't a
binary package name, or even a prefix for one.  As long as that is the
case in the archive, then the tests can hit all of apt-get()'s
codepaths with just assert_complete_one and assert_no_complete.

 Still, the question remains how to write
assert_complete_partial {ada-reference-manual-2005  ada-reference-manual-2012} "apt-get download" "ada-ref"
sync_after_int

 It's feeding bash the right input to trigger the completion, just
looking for the wrong thing on the next command line.  Is this a bug
in the test code?

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter at cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 359 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20141212/00b4dc49/attachment.sig>


More information about the Bash-completion-devel mailing list