From 9eb0ee28519c9f83817af7ab19f6375ae02e1a43 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 2 Oct 2009 16:39:11 +0200 Subject: [PATCH] (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. --- test/lib/completion.exp | 4 +++- test/lib/unit.exp | 4 +++- test/unit/_get_cword.exp | 5 ----- 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