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

_______________________________________________
Bash-completion-devel mailing list
Bash-completion-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Reply via email to