Reviewed tests e*
Fixed `assert_complete()' to remove an optional (partial) argument from `cmd' when expecting `cmd + longestCommonPrefix'. Added `prompt' argument to procs `assert_bash_exec()' & `sync_after_int()'
This commit is contained in:
parent
f615d17cb6
commit
55bc44b035
@ -1 +0,0 @@
|
||||
source "lib/completions/enscript.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/env.exp"
|
@ -1,12 +0,0 @@
|
||||
set test "Completion via _filedir_xspec() should be installed"
|
||||
set cmd "complete -p evince"
|
||||
send "$cmd\r"
|
||||
|
||||
set expected "^$cmd\r\ncomplete -o filenames -F _filedir_xspec evince\r\n/@$"
|
||||
expect {
|
||||
-re $expected { pass "$test" }
|
||||
-re /@ { fail "$test at prompt" }
|
||||
}; # expect
|
||||
|
||||
|
||||
source "lib/completions/evince.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/expand.exp"
|
3
test/completion/enscript.exp
Normal file
3
test/completion/enscript.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {enscript}]} {
|
||||
source "lib/completions/enscript.exp"
|
||||
}; # if
|
3
test/completion/env.exp
Normal file
3
test/completion/env.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {env}]} {
|
||||
source "lib/completions/env.exp"
|
||||
}; # if
|
1
test/completion/evince.exp
Normal file
1
test/completion/evince.exp
Normal file
@ -0,0 +1 @@
|
||||
source "lib/completions/evince.exp"
|
3
test/completion/expand.exp
Normal file
3
test/completion/expand.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {expand}]} {
|
||||
source "lib/completions/expand.exp"
|
||||
}; # if
|
0
test/fixtures/evince/.BMP
vendored
Normal file
0
test/fixtures/evince/.BMP
vendored
Normal file
0
test/fixtures/evince/.CBR
vendored
Normal file
0
test/fixtures/evince/.CBR
vendored
Normal file
0
test/fixtures/evince/.CBZ
vendored
Normal file
0
test/fixtures/evince/.CBZ
vendored
Normal file
0
test/fixtures/evince/.DJV
vendored
Normal file
0
test/fixtures/evince/.DJV
vendored
Normal file
0
test/fixtures/evince/.DJVU
vendored
Normal file
0
test/fixtures/evince/.DJVU
vendored
Normal file
0
test/fixtures/evince/.DVI
vendored
Normal file
0
test/fixtures/evince/.DVI
vendored
Normal file
0
test/fixtures/evince/.DVI.BZ2
vendored
Normal file
0
test/fixtures/evince/.DVI.BZ2
vendored
Normal file
0
test/fixtures/evince/.DVI.GZ
vendored
Normal file
0
test/fixtures/evince/.DVI.GZ
vendored
Normal file
0
test/fixtures/evince/.DVI.bz2
vendored
Normal file
0
test/fixtures/evince/.DVI.bz2
vendored
Normal file
0
test/fixtures/evince/.DVI.gz
vendored
Normal file
0
test/fixtures/evince/.DVI.gz
vendored
Normal file
0
test/fixtures/evince/.EPS
vendored
Normal file
0
test/fixtures/evince/.EPS
vendored
Normal file
0
test/fixtures/evince/.EPS.BZ2
vendored
Normal file
0
test/fixtures/evince/.EPS.BZ2
vendored
Normal file
0
test/fixtures/evince/.EPS.GZ
vendored
Normal file
0
test/fixtures/evince/.EPS.GZ
vendored
Normal file
0
test/fixtures/evince/.EPS.bz2
vendored
Normal file
0
test/fixtures/evince/.EPS.bz2
vendored
Normal file
0
test/fixtures/evince/.EPS.gz
vendored
Normal file
0
test/fixtures/evince/.EPS.gz
vendored
Normal file
0
test/fixtures/evince/.GIF
vendored
Normal file
0
test/fixtures/evince/.GIF
vendored
Normal file
0
test/fixtures/evince/.ICO
vendored
Normal file
0
test/fixtures/evince/.ICO
vendored
Normal file
0
test/fixtures/evince/.JPEG
vendored
Normal file
0
test/fixtures/evince/.JPEG
vendored
Normal file
0
test/fixtures/evince/.JPG
vendored
Normal file
0
test/fixtures/evince/.JPG
vendored
Normal file
0
test/fixtures/evince/.MIFF
vendored
Normal file
0
test/fixtures/evince/.MIFF
vendored
Normal file
0
test/fixtures/evince/.PBM
vendored
Normal file
0
test/fixtures/evince/.PBM
vendored
Normal file
0
test/fixtures/evince/.PCX
vendored
Normal file
0
test/fixtures/evince/.PCX
vendored
Normal file
0
test/fixtures/evince/.PDF
vendored
Normal file
0
test/fixtures/evince/.PDF
vendored
Normal file
0
test/fixtures/evince/.PDF.BZ2
vendored
Normal file
0
test/fixtures/evince/.PDF.BZ2
vendored
Normal file
0
test/fixtures/evince/.PDF.GZ
vendored
Normal file
0
test/fixtures/evince/.PDF.GZ
vendored
Normal file
0
test/fixtures/evince/.PDF.bz2
vendored
Normal file
0
test/fixtures/evince/.PDF.bz2
vendored
Normal file
0
test/fixtures/evince/.PDF.gz
vendored
Normal file
0
test/fixtures/evince/.PDF.gz
vendored
Normal file
0
test/fixtures/evince/.PGM
vendored
Normal file
0
test/fixtures/evince/.PGM
vendored
Normal file
0
test/fixtures/evince/.PNG
vendored
Normal file
0
test/fixtures/evince/.PNG
vendored
Normal file
0
test/fixtures/evince/.PNM
vendored
Normal file
0
test/fixtures/evince/.PNM
vendored
Normal file
0
test/fixtures/evince/.PPM
vendored
Normal file
0
test/fixtures/evince/.PPM
vendored
Normal file
0
test/fixtures/evince/.PS
vendored
Normal file
0
test/fixtures/evince/.PS
vendored
Normal file
0
test/fixtures/evince/.PS.BZ2
vendored
Normal file
0
test/fixtures/evince/.PS.BZ2
vendored
Normal file
0
test/fixtures/evince/.PS.GZ
vendored
Normal file
0
test/fixtures/evince/.PS.GZ
vendored
Normal file
0
test/fixtures/evince/.PS.bz2
vendored
Normal file
0
test/fixtures/evince/.PS.bz2
vendored
Normal file
0
test/fixtures/evince/.PS.gz
vendored
Normal file
0
test/fixtures/evince/.PS.gz
vendored
Normal file
0
test/fixtures/evince/.TGA
vendored
Normal file
0
test/fixtures/evince/.TGA
vendored
Normal file
0
test/fixtures/evince/.TIF
vendored
Normal file
0
test/fixtures/evince/.TIF
vendored
Normal file
0
test/fixtures/evince/.TIFF
vendored
Normal file
0
test/fixtures/evince/.TIFF
vendored
Normal file
0
test/fixtures/evince/.XPM
vendored
Normal file
0
test/fixtures/evince/.XPM
vendored
Normal file
0
test/fixtures/evince/.XWD
vendored
Normal file
0
test/fixtures/evince/.XWD
vendored
Normal file
0
test/fixtures/evince/.bmp
vendored
Normal file
0
test/fixtures/evince/.bmp
vendored
Normal file
0
test/fixtures/evince/.cbr
vendored
Normal file
0
test/fixtures/evince/.cbr
vendored
Normal file
0
test/fixtures/evince/.cbz
vendored
Normal file
0
test/fixtures/evince/.cbz
vendored
Normal file
0
test/fixtures/evince/.djv
vendored
Normal file
0
test/fixtures/evince/.djv
vendored
Normal file
0
test/fixtures/evince/.djvu
vendored
Normal file
0
test/fixtures/evince/.djvu
vendored
Normal file
0
test/fixtures/evince/.dvi
vendored
Normal file
0
test/fixtures/evince/.dvi
vendored
Normal file
0
test/fixtures/evince/.dvi.BZ2
vendored
Normal file
0
test/fixtures/evince/.dvi.BZ2
vendored
Normal file
0
test/fixtures/evince/.dvi.GZ
vendored
Normal file
0
test/fixtures/evince/.dvi.GZ
vendored
Normal file
0
test/fixtures/evince/.dvi.bz2
vendored
Normal file
0
test/fixtures/evince/.dvi.bz2
vendored
Normal file
0
test/fixtures/evince/.dvi.gz
vendored
Normal file
0
test/fixtures/evince/.dvi.gz
vendored
Normal file
0
test/fixtures/evince/.eps
vendored
Normal file
0
test/fixtures/evince/.eps
vendored
Normal file
0
test/fixtures/evince/.eps.BZ2
vendored
Normal file
0
test/fixtures/evince/.eps.BZ2
vendored
Normal file
0
test/fixtures/evince/.eps.GZ
vendored
Normal file
0
test/fixtures/evince/.eps.GZ
vendored
Normal file
0
test/fixtures/evince/.eps.bz2
vendored
Normal file
0
test/fixtures/evince/.eps.bz2
vendored
Normal file
0
test/fixtures/evince/.eps.gz
vendored
Normal file
0
test/fixtures/evince/.eps.gz
vendored
Normal file
0
test/fixtures/evince/.gif
vendored
Normal file
0
test/fixtures/evince/.gif
vendored
Normal file
0
test/fixtures/evince/.ico
vendored
Normal file
0
test/fixtures/evince/.ico
vendored
Normal file
0
test/fixtures/evince/.jpeg
vendored
Normal file
0
test/fixtures/evince/.jpeg
vendored
Normal file
0
test/fixtures/evince/.jpg
vendored
Normal file
0
test/fixtures/evince/.jpg
vendored
Normal file
0
test/fixtures/evince/.miff
vendored
Normal file
0
test/fixtures/evince/.miff
vendored
Normal file
0
test/fixtures/evince/.pbm
vendored
Normal file
0
test/fixtures/evince/.pbm
vendored
Normal file
0
test/fixtures/evince/.pcx
vendored
Normal file
0
test/fixtures/evince/.pcx
vendored
Normal file
0
test/fixtures/evince/.pdf
vendored
Normal file
0
test/fixtures/evince/.pdf
vendored
Normal file
0
test/fixtures/evince/.pdf.BZ2
vendored
Normal file
0
test/fixtures/evince/.pdf.BZ2
vendored
Normal file
0
test/fixtures/evince/.pdf.GZ
vendored
Normal file
0
test/fixtures/evince/.pdf.GZ
vendored
Normal file
0
test/fixtures/evince/.pdf.bz2
vendored
Normal file
0
test/fixtures/evince/.pdf.bz2
vendored
Normal file
0
test/fixtures/evince/.pdf.gz
vendored
Normal file
0
test/fixtures/evince/.pdf.gz
vendored
Normal file
0
test/fixtures/evince/.pgm
vendored
Normal file
0
test/fixtures/evince/.pgm
vendored
Normal file
0
test/fixtures/evince/.png
vendored
Normal file
0
test/fixtures/evince/.png
vendored
Normal file
0
test/fixtures/evince/.pnm
vendored
Normal file
0
test/fixtures/evince/.pnm
vendored
Normal file
0
test/fixtures/evince/.ppm
vendored
Normal file
0
test/fixtures/evince/.ppm
vendored
Normal file
0
test/fixtures/evince/.ps
vendored
Normal file
0
test/fixtures/evince/.ps
vendored
Normal file
0
test/fixtures/evince/.ps.BZ2
vendored
Normal file
0
test/fixtures/evince/.ps.BZ2
vendored
Normal file
0
test/fixtures/evince/.ps.GZ
vendored
Normal file
0
test/fixtures/evince/.ps.GZ
vendored
Normal file
0
test/fixtures/evince/.ps.bz2
vendored
Normal file
0
test/fixtures/evince/.ps.bz2
vendored
Normal file
0
test/fixtures/evince/.ps.gz
vendored
Normal file
0
test/fixtures/evince/.ps.gz
vendored
Normal file
0
test/fixtures/evince/.tga
vendored
Normal file
0
test/fixtures/evince/.tga
vendored
Normal file
0
test/fixtures/evince/.tif
vendored
Normal file
0
test/fixtures/evince/.tif
vendored
Normal file
0
test/fixtures/evince/.tiff
vendored
Normal file
0
test/fixtures/evince/.tiff
vendored
Normal file
0
test/fixtures/evince/.txt
vendored
Normal file
0
test/fixtures/evince/.txt
vendored
Normal file
0
test/fixtures/evince/.xpm
vendored
Normal file
0
test/fixtures/evince/.xpm
vendored
Normal file
0
test/fixtures/evince/.xwd
vendored
Normal file
0
test/fixtures/evince/.xwd
vendored
Normal file
20
test/lib/completions/enscript.exp
Normal file
20
test/lib/completions/enscript.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "enscript --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/env.exp
Normal file
20
test/lib/completions/env.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "env --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
33
test/lib/completions/evince.exp
Normal file
33
test/lib/completions/evince.exp
Normal file
@ -0,0 +1,33 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified {/OLDPWD=/d}
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
set files {
|
||||
foo/
|
||||
.bmp .BMP .cbr .CBR .cbz .CBZ .djv .DJV .djvu .DJVU
|
||||
.dvi .DVI .dvi.bz2 .dvi.BZ2 .DVI.bz2 .DVI.BZ2 .dvi.gz .dvi.GZ .DVI.gz .DVI.GZ
|
||||
.eps .EPS .eps.bz2 .eps.BZ2 .EPS.bz2 .EPS.BZ2 .eps.gz .eps.GZ .EPS.gz .EPS.GZ
|
||||
.gif .GIF .ico .ICO .jpeg .JPEG .jpg .JPG .miff .MIFF .pbm .PBM .pcx .PCX
|
||||
.pdf .PDF .pdf.bz2 .pdf.BZ2 .PDF.bz2 .PDF.BZ2 .pdf.gz .pdf.GZ .PDF.gz .PDF.GZ
|
||||
.pgm .PGM .png .PNG .pnm .PNM .ppm .PPM
|
||||
.ps .PS .ps.bz2 .ps.BZ2 .PS.bz2 .PS.BZ2 .ps.gz .ps.GZ .PS.gz .PS.GZ
|
||||
.tga .TGA .tif .TIF .tiff .TIFF
|
||||
.xpm .XPM .xwd .XWD
|
||||
}
|
||||
set prompt "/fixtures/evince/@"
|
||||
assert_bash_exec "cd fixtures/evince" "" $prompt
|
||||
assert_complete $files "evince " "" $prompt
|
||||
sync_after_int $prompt
|
||||
assert_bash_exec "cd ../.."
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/expand.exp
Normal file
20
test/lib/completions/expand.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "expand --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
@ -33,11 +33,11 @@ sync_after_int
|
||||
set test "Tab should complete hostnames"
|
||||
# Build string list of hostnames
|
||||
set hosts {}
|
||||
foreach h [exec bash -c "compgen -A hostname"] {
|
||||
foreach h [get_hosts] {
|
||||
# Prefix hosts with username 'test@'
|
||||
lappend hosts "test@$h"
|
||||
}; # foreach
|
||||
assert_complete $hosts "finger test@" $test
|
||||
assert_complete_partial $hosts finger test@ $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
@ -48,7 +48,7 @@ set test "Tab should complete partial hostname"
|
||||
# host.
|
||||
set hosts {}
|
||||
set char ""
|
||||
foreach h [exec bash -c "compgen -A hostname"] {
|
||||
foreach h [get_hosts] {
|
||||
if {$char == ""} {set char [string range $h 0 0]}
|
||||
# Only append hostname if starting with $char
|
||||
if {[string range $h 0 0] == "$char"} {
|
||||
|
@ -1,26 +0,0 @@
|
||||
proc setup {} {
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
set test "Tab should complete"
|
||||
# Try completion
|
||||
set cmd "enscript "
|
||||
send "$cmd\t"
|
||||
expect {
|
||||
-re "^$cmd\r\n.*$cmd$" { pass "$test" }
|
||||
-re /@ { unresolved "$test at prompt" }
|
||||
-re eof { unresolved "eof" }
|
||||
}; # expect
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
@ -1,31 +0,0 @@
|
||||
proc setup {} {
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
set test "Tab should complete"
|
||||
# Try completion
|
||||
set cmd "env "
|
||||
send "$cmd\t"
|
||||
expect {
|
||||
-re "^$cmd\r\n.*$cmd$" { pass "$test" }
|
||||
-re /@ { unresolved "$test at prompt" }
|
||||
-re eof { unresolved "eof" }
|
||||
}; # expect
|
||||
|
||||
|
||||
# Interrupt command
|
||||
|
||||
set test "Sync after INT"
|
||||
sleep 0.01
|
||||
send \031\003; # QUIT/INT
|
||||
expect -ex /@
|
||||
|
||||
|
||||
teardown
|
@ -1,32 +0,0 @@
|
||||
proc setup {} {
|
||||
set cmd "touch fixture1/t.{CB{R,Z},DJV{,U},cb{r,z},djv{,u}}"; # Create temporary files
|
||||
send "$cmd\r"
|
||||
expect -ex "$cmd\r\n/@"
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
set cmd "rm fixture1/t.{CB{R,Z},DJV{,U},cb{r,z},djv{,u}}"; # Remove temporary files
|
||||
send "$cmd\r"
|
||||
expect -ex "$cmd\r\n/@"
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
set test "Tab should complete evince"
|
||||
# Try completion
|
||||
set cmd "evince fixture1/"
|
||||
send "$cmd\t"
|
||||
expect {
|
||||
-re "^${cmd}\r\n(\.svn/ +|)bar bar.d/ +foo.d/ +(\.svn/ +|)t.cbr +t.CBR +t.cbz +t.CBZ +t.djv +t.DJV +t.djvu +t.DJVU *\r\n/@$cmd$" { pass "$test" }
|
||||
-re /@ { unresolved "$test at prompt" }
|
||||
default { unresolved "$test" }
|
||||
}; # expect
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
@ -1,26 +0,0 @@
|
||||
proc setup {} {
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
set test "Tab should complete"
|
||||
# Try completion
|
||||
set cmd "expand "
|
||||
send "$cmd\t"
|
||||
expect {
|
||||
-re "^$cmd\r\n.*$cmd$" { pass "$test" }
|
||||
-re /@ { unresolved "$test at prompt" }
|
||||
-re eof { unresolved "eof" }
|
||||
}; # expect
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user