diff --git a/test/unit/_count_args.exp b/test/unit/_count_args.exp index 48e4cea7..fa5417eb 100644 --- a/test/unit/_count_args.exp +++ b/test/unit/_count_args.exp @@ -1,15 +1,12 @@ proc setup {} { + assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} save_env }; # setup() proc teardown {} { + assert_bash_exec {unset args COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} assert_env_unmodified { - /args=/d - /COMP_CWORD=/d - /COMP_LINE=/d - /COMP_POINT=/d - /COMP_WORDS=/d # Delete 'COMP_WORDBREAKS' occupying two lines /COMP_WORDBREAKS=/{N d} @@ -60,7 +57,7 @@ sync_after_int set test "a b -c| d should set args to 2"; # | = cursor position -set cmd {COMP_WORDS=(a b -c d); COMP_CWORD=3; COMP_LINE='a b -c d'; COMP_POINT=6; _count_args; echo -n $args} +set cmd {COMP_WORDS=(a b -c d); COMP_CWORD=2; COMP_LINE='a b -c d'; COMP_POINT=6; _count_args; echo -n $args} assert_bash_list 2 $cmd $test diff --git a/test/unit/_get_cword.exp b/test/unit/_get_cword.exp index cd2184ed..3481b4a5 100644 --- a/test/unit/_get_cword.exp +++ b/test/unit/_get_cword.exp @@ -1,14 +1,12 @@ proc setup {} { + assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} save_env }; # setup() proc teardown {} { + assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} assert_env_unmodified { - /COMP_CWORD=/d - /COMP_LINE=/d - /COMP_POINT=/d - /COMP_WORDS=/d # Delete 'COMP_WORDBREAKS' occupying two lines /COMP_WORDBREAKS=/{N d}