summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreddy Vulto <fvulto@gmail.com>2009-10-02 16:39:11 +0200
committerFreddy Vulto <fvulto@gmail.com>2009-10-02 16:39:11 +0200
commit9eb0ee28519c9f83817af7ab19f6375ae02e1a43 (patch)
treebedafb3d56e26c7958a7a611b39e579530c4c95b
parentd2c6b1ede06eda5aea424eb4262d9b7738747fc7 (diff)
downloadbash-completion-9eb0ee28519c9f83817af7ab19f6375ae02e1a43.tar.gz
(test suite) Added global var `bash_versinfo_0'
This variable was introduced by unit/_get_cword.exp but is now upgraded to a global var.
-rw-r--r--test/lib/completion.exp4
-rw-r--r--test/lib/unit.exp4
-rw-r--r--test/unit/_get_cword.exp5
3 files changed, 6 insertions, 7 deletions
diff --git a/test/lib/completion.exp b/test/lib/completion.exp
index 94fa2992..299f2691 100644
--- a/test/lib/completion.exp
+++ b/test/lib/completion.exp
@@ -8,7 +8,7 @@ proc completion_exit {} {
proc completion_start {} {
- global TESTDIR TOOL_EXECUTABLE spawn_id
+ global bash_versinfo_0 TESTDIR TOOL_EXECUTABLE spawn_id
set test "completion_start"
set TESTDIR [pwd]
@@ -21,6 +21,8 @@ proc completion_start {} {
assert_bash_exec {BASH_COMPLETION_DIR=$(cd ..; pwd)/contrib}
assert_bash_exec {BASH_COMPLETION=$(cd ..; pwd)/bash_completion}
assert_bash_exec {source $BASH_COMPLETION}
+ # Fill global var `bash_versinfo_0' with bash major version number
+ assert_bash_exec {printf "%s" "${BASH_VERSINFO[0]}"} "" /@ bash_versinfo_0
}; # completion_start()
diff --git a/test/lib/unit.exp b/test/lib/unit.exp
index 19612fdc..14e64cca 100644
--- a/test/lib/unit.exp
+++ b/test/lib/unit.exp
@@ -8,7 +8,7 @@ proc unit_exit {} {
proc unit_start {} {
- global TESTDIR TOOL_EXECUTABLE spawn_id
+ global bash_versinfo_0 TESTDIR TOOL_EXECUTABLE spawn_id
set test "unit_start"
set TESTDIR [pwd]
@@ -27,6 +27,8 @@ proc unit_start {} {
# -- FVu, Tue Sep 15 22:52:00 CEST 2009
assert_bash_exec {is_bash_version_minimal 3 2 41 || set +o history}
assert_bash_exec {source $BASH_COMPLETION}
+ # Fill global var `bash_versinfo_0' with bash major version number
+ assert_bash_exec {printf "%s" "${BASH_VERSINFO[0]}"} "" /@ bash_versinfo_0
}; # unit_start()
diff --git a/test/unit/_get_cword.exp b/test/unit/_get_cword.exp
index 94b18b54..ec29bf17 100644
--- a/test/unit/_get_cword.exp
+++ b/test/unit/_get_cword.exp
@@ -19,11 +19,6 @@ proc teardown {} {
setup
-# Retrieve bash major version number
-set bash_versinfo_0 {}
-assert_bash_exec {printf "%s" "${BASH_VERSINFO[0]}"} "" /@ bash_versinfo_0
-
-
set test "_get_cword should run without errors"
assert_bash_exec {_get_cword > /dev/null} $test