summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authorGuillaume Rousse <guillaume@oberkampf.msr-inria.inria.fr>2009-12-31 17:36:20 +0100
committerGuillaume Rousse <guillaume@oberkampf.msr-inria.inria.fr>2009-12-31 17:36:20 +0100
commit38516ee43194fd496971a9c37e23109f3816e4bf (patch)
treeeb966d67ec5dc98e363b362c30878cb85143763d /test/lib
parent8c483668c1ae20d54b7f007e2596f459dd62d2ca (diff)
parent3f0bfbc5aea5efb1d9b20384e8291d9785bf3ae0 (diff)
downloadbash-completion-38516ee43194fd496971a9c37e23109f3816e4bf.tar.gz
Merge branch 'master' of git+ssh://git.debian.org/git/bash-completion/bash-completion
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/completions/rtcwake.exp20
-rw-r--r--test/lib/library.exp26
2 files changed, 36 insertions, 10 deletions
diff --git a/test/lib/completions/rtcwake.exp b/test/lib/completions/rtcwake.exp
new file mode 100644
index 00000000..0b9a974b
--- /dev/null
+++ b/test/lib/completions/rtcwake.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rtcwake "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/library.exp b/test/lib/library.exp
index e5ce9716..0e457c84 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -417,6 +417,16 @@ proc assert_exec {cmd {stdout ''} {test ''}} {
}; # assert_exec()
+# Sort list.
+# `exec sort' is used instead of `lsort' to achieve exactly the
+# same sort order as in bash.
+# @param list $items
+# @return list Sort list
+proc bash_sort {items} {
+ return [split [exec sort << [join $items "\n"]] "\n"]
+}; # bash_sort()
+
+
# Get hostnames
# @return list Hostnames
proc get_hosts {} {
@@ -467,16 +477,6 @@ proc get_signals {} {
}; # get_signals()
-# Sort list.
-# `exec sort' is used instead of `lsort' to achieve exactly the
-# same sort order as in bash.
-# @param list $items
-# @return list Sort list
-proc bash_sort {items} {
- return [split [exec sort << [join $items "\n"]] "\n"]
-}; # bash_sort()
-
-
# Initialize tcl globals with bash variables
proc init_tcl_bash_globals {} {
global BASH_VERSINFO BASH_VERSION COMP_WORDBREAKS
@@ -488,6 +488,12 @@ proc init_tcl_bash_globals {} {
}; # init_tcl_bash_globals()
+# Detect if test suite is running under Cygwin/Windows
+proc is_cygwin {} {
+ expr {[string first [string tolower [exec uname -s]] cygwin] >= 0}
+}; # is_cygwin()
+
+
# Expect items.
# Break items into chunks because `expect' seems to have a limited buffer size
# @param list $items