[Bash-completion-devel] Bump match_max for test suite?

Freddy Vulto fvulto at gmail.com
Fri Jan 15 09:00:29 UTC 2010


On 100114 20:45, Ville Skyttä wrote:
> If I'm right, should whitespace be left-trimmed when chunking, or the regexp 
> be changed to tolerate leading whitespace?

Yes, I think you're right.  `expect' does 'eager matching', so head 
whitespace on chunks > 1 should be allowed.  Maybe somethink like this:

diff --git a/test/lib/library.exp b/test/lib/library.exp
index fe8d7e2..4cc80f7 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -510,6 +510,8 @@ proc match_items {items test {prompt /@} {size 20}} {
             regsub -all {([\^$+*?.|(){}[\]\\])} $item {\\\1} item
             append expected $item
             if {[llength $items] > 1} {append expected {\s+}};
+                # For chunks > 1, allow head whitespace 
+            if {$i > $size} {set expected "\\s+$expected"}
         }; # for
         if {[llength $items] == 1} {
             expect {


Regards,

Freddy Vulto
http://fvue.nl



More information about the Bash-completion-devel mailing list