proc setup {} { assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} save_env } proc teardown {} { assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} # Delete 'COMP_WORDBREAKS' occupying two lines assert_env_unmodified { /COMP_WORDBREAKS=/{N d } /_scp_path_esc=/d } } setup # See also ./lib/completions/alias.exp. Here `_get_cword' is actually tested # by moving the cursor left into the current word. set test "index shouldn't drop below 0" set dir $::srcdir/fixtures/_get_cword set cmd "scp" send "$cmd ääää§ se\t\r\n" expect { -re "index: substring expression < 0" { fail "$test" } -re /@ { pass "$test" } default { unresolved "$test" } } sync_after_int teardown