testsuite: Improve pkgtool tests
This commit is contained in:
parent
d0c4f5ddd2
commit
dbd8670cf4
1
test/completion/explodepkg.exp
Normal file
1
test/completion/explodepkg.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions explodepkg
|
1
test/fixtures/slackware/home/abc-4-i686-1.txz
vendored
Normal file
1
test/fixtures/slackware/home/abc-4-i686-1.txz
vendored
Normal file
@ -0,0 +1 @@
|
||||
|
1
test/fixtures/slackware/home/opq-1.0-2.i386.rpm
vendored
Normal file
1
test/fixtures/slackware/home/opq-1.0-2.i386.rpm
vendored
Normal file
@ -0,0 +1 @@
|
||||
|
1
test/fixtures/slackware/home/tcl.d/tcl.tgz
vendored
Normal file
1
test/fixtures/slackware/home/tcl.d/tcl.tgz
vendored
Normal file
@ -0,0 +1 @@
|
||||
|
24
test/fixtures/slackware/var/log/packages/radeontool-1.6.1-i486-1
vendored
Normal file
24
test/fixtures/slackware/var/log/packages/radeontool-1.6.1-i486-1
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
PACKAGE NAME: radeontool-1.6.1-i486-1
|
||||
COMPRESSED PACKAGE SIZE: 48K
|
||||
UNCOMPRESSED PACKAGE SIZE: 150K
|
||||
PACKAGE LOCATION: ./radeontool-1.6.1-i486-1.txz
|
||||
PACKAGE DESCRIPTION:
|
||||
radeontool: radeontool (small utility for ati radeon-based laptops)
|
||||
radeontool:
|
||||
radeontool: Radeontool is a small utility to control ATI Radeon-based
|
||||
radeontool: laptops' backlight and external output functions
|
||||
radeontool:
|
||||
radeontool: Homepage: http://fdd.com/software/radeon/
|
||||
radeontool:
|
||||
radeontool:
|
||||
radeontool:
|
||||
radeontool:
|
||||
radeontool:
|
||||
FILE LIST:
|
||||
./
|
||||
usr/
|
||||
usr/bin/
|
||||
usr/bin/radeontool
|
||||
usr/bin/avivotool
|
||||
install/
|
||||
install/slack-desc
|
29
test/fixtures/slackware/var/log/packages/rzip-2.1-i486-1
vendored
Normal file
29
test/fixtures/slackware/var/log/packages/rzip-2.1-i486-1
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
PACKAGE NAME: rzip-2.1-i486-1
|
||||
COMPRESSED PACKAGE SIZE: 20K
|
||||
UNCOMPRESSED PACKAGE SIZE: 50K
|
||||
PACKAGE LOCATION: ./rzip-2.1-i486-1.txz
|
||||
PACKAGE DESCRIPTION:
|
||||
rzip: rzip (a large-file compression program)
|
||||
rzip:
|
||||
rzip: rzip is a file compression program designed to do particularly well
|
||||
rzip: on very large files containing long distance redundancy.
|
||||
rzip:
|
||||
rzip: rzip was written by Andrew Tridgell.
|
||||
rzip:
|
||||
rzip:
|
||||
rzip:
|
||||
rzip:
|
||||
rzip:
|
||||
FILE LIST:
|
||||
./
|
||||
bin/
|
||||
bin/rzip
|
||||
usr/
|
||||
usr/doc/
|
||||
usr/doc/rzip-2.1/
|
||||
usr/doc/rzip-2.1/COPYING
|
||||
usr/man/
|
||||
usr/man/man1/
|
||||
usr/man/man1/rzip.1.gz
|
||||
install/
|
||||
install/slack-desc
|
25
test/lib/completions/explodepkg.exp
Normal file
25
test/lib/completions/explodepkg.exp
Normal file
@ -0,0 +1,25 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified {/OLDPWD=/d}
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
set test "should complete *.t\[gbxl\]z files and dirs"
|
||||
set dir $::srcdir/fixtures/slackware/home
|
||||
set files [split [exec bash -c "cd $dir && find . -mindepth 1 -maxdepth 1 \
|
||||
\\( -type d -printf '%P/\\n' \\) -o \
|
||||
\\( -type f -name '*.t\[bglx\]z' -printf '%P\\n' \\)"] "\n"]
|
||||
assert_complete_dir $files "explodepkg " $dir $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
@ -4,7 +4,7 @@ proc setup {} {
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
assert_env_unmodified {/OLDPWD=/d}
|
||||
}
|
||||
|
||||
|
||||
@ -17,4 +17,33 @@ assert_complete_any "installpkg -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
set test "--<TAB> should complete all long options"
|
||||
set options [list --warn --md5sum --root --infobox --terse --menu --ask \
|
||||
--priority --tagfile]
|
||||
assert_complete $options "installpkg --" $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
set test "--root should comlete only dirs"
|
||||
set dirs [split [exec bash -c "find . -type d -mindepth 1 -maxdepth 1 \
|
||||
-printf '%P/\n'"] "\n"]
|
||||
assert_complete $dirs "installpkg --root " $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
set test "should complete *.t\[gbxl\]z files and dirs"
|
||||
set dir $::srcdir/fixtures/slackware/home
|
||||
set files [split [exec bash -c "cd $dir && find . -mindepth 1 -maxdepth 1 \
|
||||
\\( -type d -printf '%P/\\n' \\) -o \
|
||||
\\( -type f -name '*.t\[bglx\]z' -printf '%P\\n' \\)"] "\n"]
|
||||
assert_complete_dir $files "installpkg " $dir $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
||||
|
@ -17,4 +17,12 @@ assert_complete_any "makepkg -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
set test "--<TAB> should complete all long options"
|
||||
set options [list --linkadd --prepend --chown]
|
||||
assert_complete $options "makepkg --" $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
||||
|
@ -4,14 +4,29 @@ proc setup {} {
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
assert_env_unmodified {/ROOT=/d}
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "removepkg -"
|
||||
set test "-<TAB> should complete all options"
|
||||
set options [list -copy -keep -preserve -warn]
|
||||
assert_complete $options "removepkg -" $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
set test "should complete files in \$ROOT/var/log/packages/"
|
||||
# set env(ROOT) [file normalize $::srcdir/fixtures/slackware]
|
||||
# set dir $env(ROOT)/var/log/packages/
|
||||
set root [file normalize $::srcdir/fixtures/slackware]
|
||||
set dir $root/var/log/packages/
|
||||
assert_bash_exec "ROOT=$root"
|
||||
set files [split [exec bash -c "cd $dir && ls"] "\n"]
|
||||
assert_complete $files "removepkg " $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
@ -4,7 +4,7 @@ proc setup {} {
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
assert_env_unmodified {/OLDPWD=/d}
|
||||
}
|
||||
|
||||
|
||||
@ -17,4 +17,23 @@ assert_complete_any "upgradepkg -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
set test "--<TAB> should complete all long options"
|
||||
set options [list --dry-run --install-new --reinstall --verbose]
|
||||
assert_complete $options "upgradepkg --" $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
set test "should complete *.t\[gbxl\]z files and dirs"
|
||||
set dir $::srcdir/fixtures/slackware/home
|
||||
set files [split [exec bash -c "cd $dir && find . -mindepth 1 -maxdepth 1 \
|
||||
\\( -type d -printf '%P/\\n' \\) -o \
|
||||
\\( -type f -name '*.t\[bglx\]z' -printf '%P\\n' \\)"] "\n"]
|
||||
assert_complete_dir $files "upgradepkg " $dir $test
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
||||
|
Loading…
x
Reference in New Issue
Block a user