[Bash-completion-devel] Weird compopt.exp unit test problem

Ville Skyttä ville.skytta at iki.fi
Thu Feb 11 07:11:03 UTC 2010


On Wednesday 10 February 2010, Freddy Vulto wrote:
> On 100210 18:16, Ville Skyttä wrote:
> > Maybe this is what you meant above put in other words, but removing the
> > "-re {a\\\'b/c} {" block from compgen.exp or hacking the regexp so that
> > it does not match makes the problem go away for me.  I don't think that's
> > the correct fix at all, but my tcl/expect-fu is not good enough so it'd
> > make sense for me to try to dig deeper.
> 
> I can't reproduce the problem on Debian or Ubuntu Jauny unfortunately. 
>  Perhaps you can try putting:
> 
>     sleep 1
> 
> in between sending bash commands to see if it's a timing problem.

Bingo.  The patch below appears to fix it for me, do you think it
would be appropriate to commit it?  Dan, does this fix it for you as well?

> Maybe the spawned bash process isn't ready for accepting new commands
>  because the "c" of "cd $TESTDIR" is eaten, strange...

After this patch, nothing gets eaten any more, according to logs all
commands are executed as they should.

diff --git a/test/unit/compgen.exp b/test/unit/compgen.exp
index 6673bf0..63b751c 100644
--- a/test/unit/compgen.exp
+++ b/test/unit/compgen.exp
@@ -41,6 +41,9 @@ expect {
     -re eof { unresolved "eof" }
 }; # expect
 sync_after_int $prompt
+# For some reason, bash might not be ready at this point yet (?), wait a bit.
+# http://lists.alioth.debian.org/pipermail/bash-completion-devel/2010-February/002566.html
+sleep 1
 assert_bash_exec {cd "$TESTDIR"}
 
 #assert_bash_list_dir {a\\\'b/c} $cmd fixtures/compgen



More information about the Bash-completion-devel mailing list