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

Freddy Vulto fvulto at gmail.com
Mon Oct 18 20:32:23 UTC 2010


The following commit has been merged in the master branch:
commit 37f51b9df201e7944bd4c0f813cc90277c0644a8
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Mon Oct 18 22:29:59 2010 +0200

    (testsuite) Removed changing locale within 'expect'
    Changing the locale within an `expect' session might cause bash to exit.
    See: http://www.mail-archive.com/bash-completion-devel@lists.alioth.debian.org/msg02265.html

diff --git a/test/lib/library.exp b/test/lib/library.exp
index ffabefc..c5265cc 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -568,12 +568,13 @@ proc get_signals {} {
 
 # Initialize tcl globals with bash variables
 proc init_tcl_bash_globals {} {
-    global BASH_VERSINFO BASH_VERSION COMP_WORDBREAKS
+    global BASH_VERSINFO BASH_VERSION COMP_WORDBREAKS LC_CTYPE
     assert_bash_exec {printf "%s" "$COMP_WORDBREAKS"} {} /@ COMP_WORDBREAKS
     assert_bash_exec {printf "%s " "${BASH_VERSINFO[@]}"} "" /@ BASH_VERSINFO
     set BASH_VERSINFO [eval list $BASH_VERSINFO]
     assert_bash_exec {printf "%s" "$BASH_VERSION"} "" /@ BASH_VERSION
     assert_bash_exec {printf "%s" "$TESTDIR"} "" /@ TESTDIR
+    assert_bash_exec {eval $(locale); printf "%s" "$LC_CTYPE"} "" /@ LC_CTYPE
 }
 
 
diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp
index 987df52..a7202b2 100644
--- a/test/unit/_filedir.exp
+++ b/test/unit/_filedir.exp
@@ -248,12 +248,11 @@ assert_complete_dir {ee.e1 foo/ gg.e1 ii.E1} "g " "fixtures/_filedir/ext" $test
 sync_after_int
 
 
-set test "completing f aé should return g when LC_CTYPE=C"
-# Backup/set LC_CTYPE
-assert_bash_exec {OLD_CTYPE=$LC_CTYPE; LC_CTYPE=C}
-assert_complete_dir g "f aé/" "fixtures/_filedir"
-# Restore LC_CTYPE
-assert_bash_exec {[[ $OLD_CTYPE ]] && LC_CTYPE=$OLD_CTYPE || unset LC_CTYPE}
+# Execute this test only when LC_CTYPE matches *UTF-8*
+if {[string first "UTF-8" $::LC_CTYPE] != -1} {
+    set test "completing f aé should return g"
+    assert_complete_dir g "f aé/" "fixtures/_filedir"
+}
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list