/
githubmirror
/
bash-completion
Обзор
Документация
Войти
/
githubmirror
/
bash-completion
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
1.3
test/unit/compgen.exp
51 строка
1 KB
Freddy Vulto
(testuite) Fix tests to run with autotools' make distcheck
13 ноя 2010, 01:35
13 ноя 2010, 01:35
c86b336
Код
Авторство
О чём код?
proc setup {} { save_env } proc teardown {} { assert_env_unmodified {/OLDPWD/d} } setup if {[lindex $::BASH_VERSINFO 0] <= 3} { set test {compgen -f a\\\\\\\'b/ on bash-3 should return a\'b/c}; set cmd {compgen -f a\\\\\\\'b/} } else { set test {compgen -f a\\\'b/ on bash-4 should return a\'b/c}; set cmd {compgen -f a\\\'b/} } set dir $::srcdir/fixtures/compgen assert_bash_exec "cd $dir" send "$cmd\r" expect -ex "$cmd\r\n" expect { -re {a\\\'b/c} { # On bash-3.2, compgen returns inconsequent output if { [lindex $::BASH_VERSINFO 0] >= 4 || ( [lindex $::BASH_VERSINFO 0] == 3 && [lindex $::BASH_VERSINFO 1] == 2 ) } {pass $test} else {fail $test} } -re {a'b/c} { if {[lindex $::BASH_VERSINFO 0] <= 3 } \ {pass $test} else {fail $test} } -re /@ { pass "$test" } -re eof { unresolved "eof" } } sync_after_int assert_bash_exec {cd "$TESTDIR"} #assert_bash_list_dir {a\\\'b/c} $cmd $::srcdir/fixtures/compgen sync_after_int teardown