[Bash-completion-commits] [SCM] bash-completion branch, master, updated. acdf4ca55e8018b0a275940541822d53f13741b1

Freddy Vulto fvulto at gmail.com
Sun Jul 12 19:45:39 UTC 2009


The following commit has been merged in the master branch:
commit 7cdd205e76d5afd94d1e8342be4fa3895ec6ff36
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Sun Jul 12 21:37:57 2009 +0200

    (testsuite) `assert_complete' uses common prefix
    Fix `assert_complete' to expect the longest common prefix to be presented as completion.
    When trying to do a:
    
        package require textutil::string
    
    it appeared DejaGnu overwrites `unknown', the tcl function that is called to attempt autoloading.  A workaround is used for tcl auto-loading to work: `init.tcl' is reloaded to restore the original `unknown' function:
    
        source [file join [info library] init.tcl]
    
    See also: http://fvue.nl/wiki/DejaGnu:_proc_"tclPkgUnknown_..."_does_not_exist

diff --git a/test/lib/library.exp b/test/lib/library.exp
index 352d892..b152ffb 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -1,3 +1,11 @@
+    # Source `init.tcl' again to restore the `unknown' procedure
+    # NOTE: DejaGnu has an old `unknown' procedure which unfortunately disables
+    #       tcl auto-loading.
+source [file join [info library] init.tcl]
+package require textutil::string
+
+
+
 # Execute a bash command and make sure the exit status is succesful.
 # If not, output the error message.
 # @param string $cmd  Bash command line to execute.  If emptry string (""), the
@@ -70,8 +78,9 @@ proc assert_complete {expected cmd {test ""} {prompt /@} {size 20}} {
         if {[llength $expected] == 1} {
             pass "$test"
         } else {
+            set common [::textutil::string::longestCommonPrefixList $expected]
             expect {
-                -ex "$prompt$cmd" { pass "$test" }
+                -ex "$prompt$cmd$common" { pass "$test" }
                 -re $prompt { unresolved "$test at prompt" }
                 -re eof { unresolved "eof" }
             }; # expect

-- 
bash-completion



More information about the Bash-completion-commits mailing list