summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Paleino <dapal@debian.org>2011-02-06 21:26:41 +0100
committerDavid Paleino <dapal@debian.org>2011-02-06 21:26:41 +0100
commit9920a8faedf704420571d8072ccab27e9dac40ba (patch)
tree733edf3b07be06c130d04aaa1884213326722cad /test
parentf9748115fb4b2950fb4df7535fb723c4affde078 (diff)
downloadbash-completion-9920a8faedf704420571d8072ccab27e9dac40ba.tar.gz
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am10
-rw-r--r--test/Makefile.in34
-rw-r--r--test/completion/aclocal.exp1
-rw-r--r--test/completion/acroread.exp4
-rw-r--r--test/completion/autoheader.exp1
-rw-r--r--test/completion/autoreconf.exp1
-rw-r--r--test/completion/autoscan.exp1
-rw-r--r--test/completion/autoupdate.exp1
-rw-r--r--test/completion/badblocks.exp1
-rw-r--r--test/completion/crontab.exp1
-rw-r--r--test/completion/dumpe2fs.exp1
-rw-r--r--test/completion/e2freefrag.exp1
-rw-r--r--test/completion/e2label.exp1
-rw-r--r--test/completion/ether-wake.exp1
-rw-r--r--test/completion/filefrag.exp1
-rw-r--r--test/completion/finger.exp7
-rw-r--r--test/completion/freerdp.exp1
-rw-r--r--test/completion/growisofs.exp1
-rw-r--r--test/completion/hping2.exp1
-rw-r--r--test/completion/iftop.exp1
-rw-r--r--test/completion/ip.exp1
-rw-r--r--test/completion/ipmitool.exp1
-rw-r--r--test/completion/iscsiadm.exp1
-rw-r--r--test/completion/javaws.exp1
-rw-r--r--test/completion/lrzip.exp1
-rw-r--r--test/completion/lsof.exp1
-rw-r--r--test/completion/mktemp.exp1
-rw-r--r--test/completion/sh.exp1
-rw-r--r--test/completion/sqlite3.exp1
-rw-r--r--test/completion/sysbench.exp1
-rw-r--r--test/completion/tune2fs.exp1
-rw-r--r--test/completion/xfreerdp.exp1
-rw-r--r--test/completion/xmodmap.exp1
-rw-r--r--test/completion/xrdb.exp1
-rw-r--r--test/config/bashrc9
-rw-r--r--test/config/default.exp26
-rw-r--r--test/fixtures/_filedir/ext/ii.E10
-rw-r--r--test/fixtures/_known_hosts_real/known_hosts7
-rw-r--r--test/fixtures/acroread/bar0
-rw-r--r--test/fixtures/acroread/foo.d/.gitignore0
-rw-r--r--test/fixtures/acroread/t.pdf0
-rw-r--r--test/fixtures/man/man1/bar.1.bz20
-rw-r--r--test/fixtures/man/man1/foo.10
-rw-r--r--test/fixtures/man/man3/Bash::Completion.3pm.gz0
-rw-r--r--test/fixtures/scp/known_hosts1
-rw-r--r--test/fixtures/sftp/known_hosts1
-rw-r--r--test/lib/completion.exp10
-rw-r--r--test/lib/completions/a2ps.exp4
-rw-r--r--test/lib/completions/abook.exp4
-rw-r--r--test/lib/completions/aclocal.exp20
-rw-r--r--test/lib/completions/acroread.exp10
-rw-r--r--test/lib/completions/add_members.exp4
-rw-r--r--test/lib/completions/alias.exp6
-rw-r--r--test/lib/completions/animate.exp4
-rw-r--r--test/lib/completions/ant.exp4
-rw-r--r--test/lib/completions/apache2ctl.exp4
-rw-r--r--test/lib/completions/apt-build.exp4
-rw-r--r--test/lib/completions/apt-cache.exp4
-rw-r--r--test/lib/completions/apt-get.exp4
-rw-r--r--test/lib/completions/aptitude.exp4
-rw-r--r--test/lib/completions/arch.exp4
-rw-r--r--test/lib/completions/arpspoof.exp4
-rw-r--r--test/lib/completions/aspell.exp4
-rw-r--r--test/lib/completions/autoconf.exp4
-rw-r--r--test/lib/completions/autoheader.exp20
-rw-r--r--test/lib/completions/automake.exp4
-rw-r--r--test/lib/completions/autoreconf.exp20
-rw-r--r--test/lib/completions/autorpm.exp4
-rw-r--r--test/lib/completions/autoscan.exp20
-rw-r--r--test/lib/completions/autoupdate.exp20
-rw-r--r--test/lib/completions/awk.exp4
-rw-r--r--test/lib/completions/badblocks.exp20
-rw-r--r--test/lib/completions/bash.exp4
-rw-r--r--test/lib/completions/bc.exp4
-rw-r--r--test/lib/completions/bison.exp4
-rw-r--r--test/lib/completions/bk.exp4
-rw-r--r--test/lib/completions/brctl.exp4
-rw-r--r--test/lib/completions/btdownloadcurses.py.exp4
-rw-r--r--test/lib/completions/btdownloadgui.py.exp4
-rw-r--r--test/lib/completions/btdownloadheadless.py.exp4
-rw-r--r--test/lib/completions/bzip2.exp4
-rw-r--r--test/lib/completions/c++.exp4
-rw-r--r--test/lib/completions/cancel.exp8
-rw-r--r--test/lib/completions/cardctl.exp4
-rw-r--r--test/lib/completions/cat.exp4
-rw-r--r--test/lib/completions/cc.exp4
-rw-r--r--test/lib/completions/cd.exp20
-rw-r--r--test/lib/completions/cdrecord.exp4
-rw-r--r--test/lib/completions/change_pw.exp4
-rw-r--r--test/lib/completions/check_db.exp4
-rw-r--r--test/lib/completions/check_perms.exp4
-rw-r--r--test/lib/completions/chgrp.exp4
-rw-r--r--test/lib/completions/chkconfig.exp4
-rw-r--r--test/lib/completions/chown.exp11
-rw-r--r--test/lib/completions/chsh.exp4
-rw-r--r--test/lib/completions/ci.exp4
-rw-r--r--test/lib/completions/civclient.exp4
-rw-r--r--test/lib/completions/civserver.exp4
-rw-r--r--test/lib/completions/cksfv.exp4
-rw-r--r--test/lib/completions/cleanarch.exp4
-rw-r--r--test/lib/completions/clisp.exp4
-rw-r--r--test/lib/completions/clone_member.exp4
-rw-r--r--test/lib/completions/co.exp4
-rw-r--r--test/lib/completions/composite.exp4
-rw-r--r--test/lib/completions/config_list.exp4
-rw-r--r--test/lib/completions/configure.exp4
-rw-r--r--test/lib/completions/convert.exp4
-rw-r--r--test/lib/completions/cowsay.exp4
-rw-r--r--test/lib/completions/cp.exp4
-rw-r--r--test/lib/completions/cpio.exp4
-rw-r--r--test/lib/completions/createdb.exp4
-rw-r--r--test/lib/completions/crontab.exp20
-rw-r--r--test/lib/completions/cryptsetup.exp4
-rw-r--r--test/lib/completions/csplit.exp4
-rw-r--r--test/lib/completions/cut.exp4
-rw-r--r--test/lib/completions/cvs.exp8
-rw-r--r--test/lib/completions/cvsps.exp8
-rw-r--r--test/lib/completions/date.exp4
-rw-r--r--test/lib/completions/dcop.exp6
-rw-r--r--test/lib/completions/dd.exp6
-rw-r--r--test/lib/completions/df.exp4
-rw-r--r--test/lib/completions/dhclient.exp4
-rw-r--r--test/lib/completions/dict.exp4
-rw-r--r--test/lib/completions/diff.exp4
-rw-r--r--test/lib/completions/dir.exp4
-rw-r--r--test/lib/completions/display.exp4
-rw-r--r--test/lib/completions/dnsspoof.exp4
-rw-r--r--test/lib/completions/dpkg-deb.exp4
-rw-r--r--test/lib/completions/dpkg-reconfigure.exp4
-rw-r--r--test/lib/completions/dpkg-source.exp4
-rw-r--r--test/lib/completions/dpkg.exp6
-rw-r--r--test/lib/completions/dropdb.exp4
-rw-r--r--test/lib/completions/dselect.exp4
-rw-r--r--test/lib/completions/dsniff.exp4
-rw-r--r--test/lib/completions/du.exp4
-rw-r--r--test/lib/completions/dumpdb.exp4
-rw-r--r--test/lib/completions/dumpe2fs.exp20
-rw-r--r--test/lib/completions/e2freefrag.exp20
-rw-r--r--test/lib/completions/e2label.exp20
-rw-r--r--test/lib/completions/enscript.exp4
-rw-r--r--test/lib/completions/env.exp6
-rw-r--r--test/lib/completions/ether-wake.exp20
-rw-r--r--test/lib/completions/evince.exp6
-rw-r--r--test/lib/completions/expand.exp6
-rw-r--r--test/lib/completions/filefrag.exp20
-rw-r--r--test/lib/completions/filesnarf.exp4
-rw-r--r--test/lib/completions/find.exp12
-rw-r--r--test/lib/completions/find_member.exp4
-rw-r--r--test/lib/completions/finger.exp16
-rw-r--r--test/lib/completions/fmt.exp6
-rw-r--r--test/lib/completions/fold.exp6
-rw-r--r--test/lib/completions/freerdp.exp20
-rw-r--r--test/lib/completions/g++.exp4
-rw-r--r--test/lib/completions/g4.exp4
-rw-r--r--test/lib/completions/g77.exp4
-rw-r--r--test/lib/completions/gcc.exp4
-rw-r--r--test/lib/completions/gcj.exp4
-rw-r--r--test/lib/completions/gcl.exp4
-rw-r--r--test/lib/completions/gdb.exp4
-rw-r--r--test/lib/completions/genaliases.exp4
-rw-r--r--test/lib/completions/getent.exp4
-rw-r--r--test/lib/completions/gkrellm.exp4
-rw-r--r--test/lib/completions/gmplayer.exp4
-rw-r--r--test/lib/completions/gnatmake.exp4
-rw-r--r--test/lib/completions/gpc.exp4
-rw-r--r--test/lib/completions/gperf.exp4
-rw-r--r--test/lib/completions/gpg.exp4
-rw-r--r--test/lib/completions/gprof.exp6
-rw-r--r--test/lib/completions/grep.exp4
-rw-r--r--test/lib/completions/growisofs.exp20
-rw-r--r--test/lib/completions/grub.exp4
-rw-r--r--test/lib/completions/gzip.exp6
-rw-r--r--test/lib/completions/hcitool.exp4
-rw-r--r--test/lib/completions/head.exp6
-rw-r--r--test/lib/completions/hping2.exp20
-rw-r--r--test/lib/completions/iconv.exp4
-rw-r--r--test/lib/completions/id.exp4
-rw-r--r--test/lib/completions/identify.exp4
-rw-r--r--test/lib/completions/ifdown.exp4
-rw-r--r--test/lib/completions/iftop.exp20
-rw-r--r--test/lib/completions/ifup.exp4
-rw-r--r--test/lib/completions/indent.exp4
-rw-r--r--test/lib/completions/info.exp4
-rw-r--r--test/lib/completions/inject.exp4
-rw-r--r--test/lib/completions/insmod.exp4
-rw-r--r--test/lib/completions/invoke-rc.d.exp4
-rw-r--r--test/lib/completions/ip.exp20
-rw-r--r--test/lib/completions/ipmitool.exp20
-rw-r--r--test/lib/completions/ipsec.exp4
-rw-r--r--test/lib/completions/ipv6calc.exp4
-rw-r--r--test/lib/completions/irb.exp4
-rw-r--r--test/lib/completions/iscsiadm.exp20
-rw-r--r--test/lib/completions/isql.exp4
-rw-r--r--test/lib/completions/iwconfig.exp4
-rw-r--r--test/lib/completions/iwlist.exp4
-rw-r--r--test/lib/completions/iwpriv.exp4
-rw-r--r--test/lib/completions/iwspy.exp4
-rw-r--r--test/lib/completions/jar.exp4
-rw-r--r--test/lib/completions/jarsigner.exp4
-rw-r--r--test/lib/completions/java.exp10
-rw-r--r--test/lib/completions/javac.exp4
-rw-r--r--test/lib/completions/javadoc.exp4
-rw-r--r--test/lib/completions/javaws.exp20
-rw-r--r--test/lib/completions/k3b.exp4
-rw-r--r--test/lib/completions/kdvi.exp6
-rw-r--r--test/lib/completions/kill.exp4
-rw-r--r--test/lib/completions/killall.exp4
-rw-r--r--test/lib/completions/kldload.exp4
-rw-r--r--test/lib/completions/kldunload.exp4
-rw-r--r--test/lib/completions/kpdf.exp6
-rw-r--r--test/lib/completions/kplayer.exp4
-rw-r--r--test/lib/completions/larch.exp4
-rw-r--r--test/lib/completions/ld.exp4
-rw-r--r--test/lib/completions/ldd.exp4
-rw-r--r--test/lib/completions/less.exp4
-rw-r--r--test/lib/completions/lftp.exp6
-rw-r--r--test/lib/completions/lftpget.exp4
-rw-r--r--test/lib/completions/lilo.exp4
-rw-r--r--test/lib/completions/links.exp4
-rw-r--r--test/lib/completions/lisp.exp4
-rw-r--r--test/lib/completions/list_admins.exp4
-rw-r--r--test/lib/completions/list_lists.exp4
-rw-r--r--test/lib/completions/list_members.exp4
-rw-r--r--test/lib/completions/list_owners.exp4
-rw-r--r--test/lib/completions/ln.exp4
-rw-r--r--test/lib/completions/look.exp6
-rw-r--r--test/lib/completions/lrzip.exp20
-rw-r--r--test/lib/completions/ls.exp28
-rw-r--r--test/lib/completions/lsof.exp21
-rw-r--r--test/lib/completions/lvchange.exp4
-rw-r--r--test/lib/completions/lvcreate.exp4
-rw-r--r--test/lib/completions/lvdisplay.exp4
-rw-r--r--test/lib/completions/lvextend.exp4
-rw-r--r--test/lib/completions/lvm.exp4
-rw-r--r--test/lib/completions/lvmdiskscan.exp4
-rw-r--r--test/lib/completions/lvreduce.exp4
-rw-r--r--test/lib/completions/lvremove.exp4
-rw-r--r--test/lib/completions/lvrename.exp4
-rw-r--r--test/lib/completions/lvresize.exp4
-rw-r--r--test/lib/completions/lvs.exp4
-rw-r--r--test/lib/completions/lvscan.exp4
-rw-r--r--test/lib/completions/lzma.exp6
-rw-r--r--test/lib/completions/lzop.exp4
-rw-r--r--test/lib/completions/m4.exp6
-rw-r--r--test/lib/completions/macof.exp4
-rw-r--r--test/lib/completions/mailmanctl.exp4
-rw-r--r--test/lib/completions/mailsnarf.exp4
-rw-r--r--test/lib/completions/make.exp4
-rw-r--r--test/lib/completions/man.exp21
-rw-r--r--test/lib/completions/mc.exp4
-rw-r--r--test/lib/completions/mcrypt.exp4
-rw-r--r--test/lib/completions/md5sum.exp4
-rw-r--r--test/lib/completions/mdecrypt.exp4
-rw-r--r--test/lib/completions/mencoder.exp4
-rw-r--r--test/lib/completions/minicom.exp4
-rw-r--r--test/lib/completions/mkdir.exp10
-rw-r--r--test/lib/completions/mkfifo.exp4
-rw-r--r--test/lib/completions/mkinitrd.exp4
-rw-r--r--test/lib/completions/mkisofs.exp8
-rw-r--r--test/lib/completions/mknod.exp4
-rw-r--r--test/lib/completions/mktemp.exp20
-rw-r--r--test/lib/completions/mmsitepass.exp4
-rw-r--r--test/lib/completions/module.exp4
-rw-r--r--test/lib/completions/mogrify.exp4
-rw-r--r--test/lib/completions/montage.exp4
-rw-r--r--test/lib/completions/mount.exp9
-rw-r--r--test/lib/completions/mplayer.exp4
-rw-r--r--test/lib/completions/msgsnarf.exp4
-rw-r--r--test/lib/completions/mtx.exp4
-rw-r--r--test/lib/completions/mutt.exp8
-rw-r--r--test/lib/completions/muttng.exp4
-rw-r--r--test/lib/completions/mv.exp4
-rw-r--r--test/lib/completions/mysqladmin.exp4
-rw-r--r--test/lib/completions/ncftp.exp4
-rw-r--r--test/lib/completions/netstat.exp4
-rw-r--r--test/lib/completions/newlist.exp4
-rw-r--r--test/lib/completions/nl.exp4
-rw-r--r--test/lib/completions/nm.exp4
-rw-r--r--test/lib/completions/ntpdate.exp4
-rw-r--r--test/lib/completions/objcopy.exp4
-rw-r--r--test/lib/completions/objdump.exp4
-rw-r--r--test/lib/completions/od.exp4
-rw-r--r--test/lib/completions/openssl.exp6
-rw-r--r--test/lib/completions/p4.exp4
-rw-r--r--test/lib/completions/pack200.exp4
-rw-r--r--test/lib/completions/paste.exp4
-rw-r--r--test/lib/completions/patch.exp4
-rw-r--r--test/lib/completions/perl.exp39
-rw-r--r--test/lib/completions/perldoc.exp21
-rw-r--r--test/lib/completions/pgrep.exp4
-rw-r--r--test/lib/completions/pine.exp4
-rw-r--r--test/lib/completions/ping.exp4
-rw-r--r--test/lib/completions/pkg-config.exp4
-rw-r--r--test/lib/completions/pkg_deinstall.exp8
-rw-r--r--test/lib/completions/pkg_delete.exp4
-rw-r--r--test/lib/completions/pkg_info.exp4
-rw-r--r--test/lib/completions/pkill.exp4
-rw-r--r--test/lib/completions/portinstall.exp8
-rw-r--r--test/lib/completions/portupgrade.exp4
-rw-r--r--test/lib/completions/povray.exp4
-rw-r--r--test/lib/completions/pr.exp4
-rw-r--r--test/lib/completions/psql.exp4
-rw-r--r--test/lib/completions/ptx.exp4
-rw-r--r--test/lib/completions/pvchange.exp4
-rw-r--r--test/lib/completions/pvcreate.exp4
-rw-r--r--test/lib/completions/pvdisplay.exp4
-rw-r--r--test/lib/completions/pvmove.exp4
-rw-r--r--test/lib/completions/pvremove.exp4
-rw-r--r--test/lib/completions/pvs.exp4
-rw-r--r--test/lib/completions/pvscan.exp4
-rw-r--r--test/lib/completions/python.exp7
-rw-r--r--test/lib/completions/qrunner.exp4
-rw-r--r--test/lib/completions/querybts.exp4
-rw-r--r--test/lib/completions/rcs.exp4
-rw-r--r--test/lib/completions/rcsdiff.exp4
-rw-r--r--test/lib/completions/rdict.exp4
-rw-r--r--test/lib/completions/readelf.exp4
-rw-r--r--test/lib/completions/readonly.exp4
-rw-r--r--test/lib/completions/remove_members.exp4
-rw-r--r--test/lib/completions/removepkg.exp4
-rw-r--r--test/lib/completions/renice.exp8
-rw-r--r--test/lib/completions/reportbug.exp4
-rw-r--r--test/lib/completions/ri.exp4
-rw-r--r--test/lib/completions/rlog.exp4
-rw-r--r--test/lib/completions/rm.exp4
-rw-r--r--test/lib/completions/rmdir.exp10
-rw-r--r--test/lib/completions/rmlist.exp4
-rw-r--r--test/lib/completions/rpcdebug.exp4
-rw-r--r--test/lib/completions/rpm.exp6
-rw-r--r--test/lib/completions/rsync.exp4
-rw-r--r--test/lib/completions/rtcwake.exp4
-rw-r--r--test/lib/completions/sbcl-mt.exp6
-rw-r--r--test/lib/completions/sbcl.exp6
-rw-r--r--test/lib/completions/scp.exp43
-rw-r--r--test/lib/completions/screen.exp33
-rw-r--r--test/lib/completions/sed.exp6
-rw-r--r--test/lib/completions/seq.exp4
-rw-r--r--test/lib/completions/service.exp4
-rw-r--r--test/lib/completions/set.exp4
-rw-r--r--test/lib/completions/sftp.exp45
-rw-r--r--test/lib/completions/sh.exp38
-rw-r--r--test/lib/completions/sha1sum.exp4
-rw-r--r--test/lib/completions/shar.exp4
-rw-r--r--test/lib/completions/sitecopy.exp4
-rw-r--r--test/lib/completions/smartctl.exp4
-rw-r--r--test/lib/completions/snownews.exp4
-rw-r--r--test/lib/completions/sort.exp4
-rw-r--r--test/lib/completions/split.exp6
-rw-r--r--test/lib/completions/spovray.exp4
-rw-r--r--test/lib/completions/sqlite3.exp20
-rw-r--r--test/lib/completions/ssh.exp41
-rw-r--r--test/lib/completions/sshmitm.exp4
-rw-r--r--test/lib/completions/sshow.exp4
-rw-r--r--test/lib/completions/strace.exp4
-rw-r--r--test/lib/completions/strip.exp4
-rw-r--r--test/lib/completions/sudo.exp15
-rw-r--r--test/lib/completions/svk.exp4
-rw-r--r--test/lib/completions/svn.exp4
-rw-r--r--test/lib/completions/svnadmin.exp4
-rw-r--r--test/lib/completions/svnlook.exp4
-rw-r--r--test/lib/completions/sync_members.exp4
-rw-r--r--test/lib/completions/sysbench.exp20
-rw-r--r--test/lib/completions/sysctl.exp9
-rw-r--r--test/lib/completions/tac.exp4
-rw-r--r--test/lib/completions/tail.exp6
-rw-r--r--test/lib/completions/tar.exp4
-rw-r--r--test/lib/completions/tcpkill.exp4
-rw-r--r--test/lib/completions/tcpnice.exp4
-rw-r--r--test/lib/completions/tee.exp4
-rw-r--r--test/lib/completions/texindex.exp4
-rw-r--r--test/lib/completions/tightvncviewer.exp4
-rw-r--r--test/lib/completions/time.exp4
-rw-r--r--test/lib/completions/touch.exp6
-rw-r--r--test/lib/completions/tr.exp6
-rw-r--r--test/lib/completions/tune2fs.exp20
-rw-r--r--test/lib/completions/unace.exp4
-rw-r--r--test/lib/completions/uname.exp6
-rw-r--r--test/lib/completions/unexpand.exp6
-rw-r--r--test/lib/completions/uniq.exp6
-rw-r--r--test/lib/completions/units.exp6
-rw-r--r--test/lib/completions/unpack200.exp4
-rw-r--r--test/lib/completions/unrar.exp4
-rw-r--r--test/lib/completions/unset.exp4
-rw-r--r--test/lib/completions/unshunt.exp4
-rw-r--r--test/lib/completions/update-alternatives.exp4
-rw-r--r--test/lib/completions/update-rc.d.exp4
-rw-r--r--test/lib/completions/urlsnarf.exp4
-rw-r--r--test/lib/completions/vdir.exp4
-rw-r--r--test/lib/completions/vgcfgbackup.exp4
-rw-r--r--test/lib/completions/vgcfgrestore.exp4
-rw-r--r--test/lib/completions/vgchange.exp4
-rw-r--r--test/lib/completions/vgck.exp4
-rw-r--r--test/lib/completions/vgconvert.exp4
-rw-r--r--test/lib/completions/vgcreate.exp4
-rw-r--r--test/lib/completions/vgdisplay.exp4
-rw-r--r--test/lib/completions/vgexport.exp4
-rw-r--r--test/lib/completions/vgextend.exp4
-rw-r--r--test/lib/completions/vgimport.exp4
-rw-r--r--test/lib/completions/vgmerge.exp4
-rw-r--r--test/lib/completions/vgmknodes.exp4
-rw-r--r--test/lib/completions/vgreduce.exp4
-rw-r--r--test/lib/completions/vgremove.exp4
-rw-r--r--test/lib/completions/vgrename.exp4
-rw-r--r--test/lib/completions/vgs.exp4
-rw-r--r--test/lib/completions/vgscan.exp4
-rw-r--r--test/lib/completions/vgsplit.exp4
-rw-r--r--test/lib/completions/vncviewer.exp4
-rw-r--r--test/lib/completions/wc.exp6
-rw-r--r--test/lib/completions/webmitm.exp4
-rw-r--r--test/lib/completions/wget.exp4
-rw-r--r--test/lib/completions/who.exp6
-rw-r--r--test/lib/completions/withlist.exp4
-rw-r--r--test/lib/completions/wol.exp6
-rw-r--r--test/lib/completions/wtf.exp4
-rw-r--r--test/lib/completions/wvdial.exp4
-rw-r--r--test/lib/completions/xfreerdp.exp28
-rw-r--r--test/lib/completions/xhost.exp37
-rw-r--r--test/lib/completions/xmllint.exp4
-rw-r--r--test/lib/completions/xmlwf.exp4
-rw-r--r--test/lib/completions/xmms.exp4
-rw-r--r--test/lib/completions/xmodmap.exp20
-rw-r--r--test/lib/completions/xpovray.exp4
-rw-r--r--test/lib/completions/xrandr.exp4
-rw-r--r--test/lib/completions/xrdb.exp20
-rw-r--r--test/lib/completions/xsltproc.exp4
-rw-r--r--test/lib/completions/xvnc4viewer.exp4
-rw-r--r--test/lib/completions/xz.exp12
-rw-r--r--test/lib/completions/ypcat.exp4
-rw-r--r--test/lib/completions/ypmatch.exp4
-rw-r--r--test/lib/completions/yum-arch.exp4
-rw-r--r--test/lib/completions/yum.exp4
-rw-r--r--test/lib/library.exp618
-rw-r--r--test/lib/unit.exp10
-rw-r--r--test/unit/__expand_tilde_by_ref.exp16
-rw-r--r--test/unit/_count_args.exp14
-rw-r--r--test/unit/_filedir.exp82
-rw-r--r--test/unit/_get_comp_words_by_ref.exp47
-rw-r--r--test/unit/_get_cword.exp58
-rw-r--r--test/unit/_known_hosts_real.exp34
-rw-r--r--test/unit/_parse_help.exp73
-rw-r--r--test/unit/_tilde.exp51
-rw-r--r--test/unit/compgen.exp19
442 files changed, 2347 insertions, 1328 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index d955be8a..82f6df90 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,8 +1,16 @@
DEJATOOL = completion install unit
-AM_RUNTESTFLAGS = --outdir log
+AM_RUNTESTFLAGS = --outdir log --ignore $(PACKAGE).log
EXTRA_DIST = completion \
config \
fixtures \
lib \
unit
+
+all:
+ $(mkdir_p) log tmp
+
+distclean-local:
+ rm -rf log tmp
+
+AUTOMAKE_OPTIONS = dejagnu
diff --git a/test/Makefile.in b/test/Makefile.in
index a1376c9f..aa81fbeb 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -86,6 +86,7 @@ abs_top_srcdir = @abs_top_srcdir@
am__leading_dot = @am__leading_dot@
am__tar = @am__tar@
am__untar = @am__untar@
+bashcompdir = @bashcompdir@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
@@ -94,6 +95,7 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+helpersdir = @helpersdir@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
@@ -119,13 +121,14 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
DEJATOOL = completion install unit
-AM_RUNTESTFLAGS = --outdir log
+AM_RUNTESTFLAGS = --outdir log --ignore $(PACKAGE).log
EXTRA_DIST = completion \
config \
fixtures \
lib \
unit
+AUTOMAKE_OPTIONS = dejagnu
all: all-am
.SUFFIXES:
@@ -264,7 +267,8 @@ clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
-distclean-am: clean-am distclean-DEJAGNU distclean-generic
+distclean-am: clean-am distclean-DEJAGNU distclean-generic \
+ distclean-local
dvi: dvi-am
@@ -327,16 +331,22 @@ uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
- distclean distclean-DEJAGNU distclean-generic distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am uninstall uninstall-am
-
+ distclean distclean-DEJAGNU distclean-generic distclean-local \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+all:
+ $(mkdir_p) log tmp
+
+distclean-local:
+ rm -rf log tmp
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/test/completion/aclocal.exp b/test/completion/aclocal.exp
new file mode 100644
index 00000000..477921a9
--- /dev/null
+++ b/test/completion/aclocal.exp
@@ -0,0 +1 @@
+assert_source_completions aclocal
diff --git a/test/completion/acroread.exp b/test/completion/acroread.exp
index c3635ae8..6ee03d6e 100644
--- a/test/completion/acroread.exp
+++ b/test/completion/acroread.exp
@@ -2,11 +2,11 @@ set test "Completion via _filedir_xspec() should be installed"
set cmd "complete -p acroread"
send "$cmd\r"
-set expected "^$cmd\r\ncomplete -o filenames -F _filedir_xspec acroread\r\n/@$"
+set expected "^$cmd\r\ncomplete -F _filedir_xspec acroread\r\n/@$"
expect {
-re $expected { pass "$test" }
-re /@ { fail "$test at prompt" }
}; # expect
-source "lib/completions/acroread.exp"
+source "$::srcdir/lib/completions/acroread.exp"
diff --git a/test/completion/autoheader.exp b/test/completion/autoheader.exp
new file mode 100644
index 00000000..b797371a
--- /dev/null
+++ b/test/completion/autoheader.exp
@@ -0,0 +1 @@
+assert_source_completions autoheader
diff --git a/test/completion/autoreconf.exp b/test/completion/autoreconf.exp
new file mode 100644
index 00000000..337d11f7
--- /dev/null
+++ b/test/completion/autoreconf.exp
@@ -0,0 +1 @@
+assert_source_completions autoreconf
diff --git a/test/completion/autoscan.exp b/test/completion/autoscan.exp
new file mode 100644
index 00000000..9fc76858
--- /dev/null
+++ b/test/completion/autoscan.exp
@@ -0,0 +1 @@
+assert_source_completions autoscan
diff --git a/test/completion/autoupdate.exp b/test/completion/autoupdate.exp
new file mode 100644
index 00000000..f56f4c6d
--- /dev/null
+++ b/test/completion/autoupdate.exp
@@ -0,0 +1 @@
+assert_source_completions autoupdate
diff --git a/test/completion/badblocks.exp b/test/completion/badblocks.exp
new file mode 100644
index 00000000..74bfcd5d
--- /dev/null
+++ b/test/completion/badblocks.exp
@@ -0,0 +1 @@
+assert_source_completions badblocks
diff --git a/test/completion/crontab.exp b/test/completion/crontab.exp
new file mode 100644
index 00000000..2a649491
--- /dev/null
+++ b/test/completion/crontab.exp
@@ -0,0 +1 @@
+assert_source_completions crontab
diff --git a/test/completion/dumpe2fs.exp b/test/completion/dumpe2fs.exp
new file mode 100644
index 00000000..22d1523c
--- /dev/null
+++ b/test/completion/dumpe2fs.exp
@@ -0,0 +1 @@
+assert_source_completions dumpe2fs
diff --git a/test/completion/e2freefrag.exp b/test/completion/e2freefrag.exp
new file mode 100644
index 00000000..713ee236
--- /dev/null
+++ b/test/completion/e2freefrag.exp
@@ -0,0 +1 @@
+assert_source_completions e2freefrag
diff --git a/test/completion/e2label.exp b/test/completion/e2label.exp
new file mode 100644
index 00000000..2383c98e
--- /dev/null
+++ b/test/completion/e2label.exp
@@ -0,0 +1 @@
+assert_source_completions e2label
diff --git a/test/completion/ether-wake.exp b/test/completion/ether-wake.exp
new file mode 100644
index 00000000..602ba271
--- /dev/null
+++ b/test/completion/ether-wake.exp
@@ -0,0 +1 @@
+assert_source_completions ether-wake
diff --git a/test/completion/filefrag.exp b/test/completion/filefrag.exp
new file mode 100644
index 00000000..eeb5f8ce
--- /dev/null
+++ b/test/completion/filefrag.exp
@@ -0,0 +1 @@
+assert_source_completions filefrag
diff --git a/test/completion/finger.exp b/test/completion/finger.exp
index cc77abe5..7c7b8a26 100644
--- a/test/completion/finger.exp
+++ b/test/completion/finger.exp
@@ -1,6 +1 @@
-source "lib/completions/finger.exp"
-
-# TODO: Dynamic loading of completions. After the tests have run a first time
-# and real completion is installed, the tests can be run a second time.
-#
-# source "lib/completions/finger.exp"
+assert_source_completions finger
diff --git a/test/completion/freerdp.exp b/test/completion/freerdp.exp
new file mode 100644
index 00000000..5ca649a2
--- /dev/null
+++ b/test/completion/freerdp.exp
@@ -0,0 +1 @@
+assert_source_completions xfreerdp
diff --git a/test/completion/growisofs.exp b/test/completion/growisofs.exp
new file mode 100644
index 00000000..57cb991b
--- /dev/null
+++ b/test/completion/growisofs.exp
@@ -0,0 +1 @@
+assert_source_completions growisofs
diff --git a/test/completion/hping2.exp b/test/completion/hping2.exp
new file mode 100644
index 00000000..e9df7c2b
--- /dev/null
+++ b/test/completion/hping2.exp
@@ -0,0 +1 @@
+assert_source_completions hping2
diff --git a/test/completion/iftop.exp b/test/completion/iftop.exp
new file mode 100644
index 00000000..5ec1cb57
--- /dev/null
+++ b/test/completion/iftop.exp
@@ -0,0 +1 @@
+assert_source_completions iftop
diff --git a/test/completion/ip.exp b/test/completion/ip.exp
new file mode 100644
index 00000000..e80841e8
--- /dev/null
+++ b/test/completion/ip.exp
@@ -0,0 +1 @@
+assert_source_completions ip
diff --git a/test/completion/ipmitool.exp b/test/completion/ipmitool.exp
new file mode 100644
index 00000000..a5c72a78
--- /dev/null
+++ b/test/completion/ipmitool.exp
@@ -0,0 +1 @@
+assert_source_completions ipmitool
diff --git a/test/completion/iscsiadm.exp b/test/completion/iscsiadm.exp
new file mode 100644
index 00000000..6d760dd4
--- /dev/null
+++ b/test/completion/iscsiadm.exp
@@ -0,0 +1 @@
+assert_source_completions iscsiadm
diff --git a/test/completion/javaws.exp b/test/completion/javaws.exp
new file mode 100644
index 00000000..c1c6b106
--- /dev/null
+++ b/test/completion/javaws.exp
@@ -0,0 +1 @@
+assert_source_completions javaws
diff --git a/test/completion/lrzip.exp b/test/completion/lrzip.exp
new file mode 100644
index 00000000..60616f00
--- /dev/null
+++ b/test/completion/lrzip.exp
@@ -0,0 +1 @@
+assert_source_completions lrzip
diff --git a/test/completion/lsof.exp b/test/completion/lsof.exp
new file mode 100644
index 00000000..98baab04
--- /dev/null
+++ b/test/completion/lsof.exp
@@ -0,0 +1 @@
+assert_source_completions lsof
diff --git a/test/completion/mktemp.exp b/test/completion/mktemp.exp
new file mode 100644
index 00000000..b8296865
--- /dev/null
+++ b/test/completion/mktemp.exp
@@ -0,0 +1 @@
+assert_source_completions mktemp
diff --git a/test/completion/sh.exp b/test/completion/sh.exp
new file mode 100644
index 00000000..599f3b29
--- /dev/null
+++ b/test/completion/sh.exp
@@ -0,0 +1 @@
+assert_source_completions sh
diff --git a/test/completion/sqlite3.exp b/test/completion/sqlite3.exp
new file mode 100644
index 00000000..88195e0d
--- /dev/null
+++ b/test/completion/sqlite3.exp
@@ -0,0 +1 @@
+assert_source_completions sqlite3
diff --git a/test/completion/sysbench.exp b/test/completion/sysbench.exp
new file mode 100644
index 00000000..68da0a7a
--- /dev/null
+++ b/test/completion/sysbench.exp
@@ -0,0 +1 @@
+assert_source_completions sysbench
diff --git a/test/completion/tune2fs.exp b/test/completion/tune2fs.exp
new file mode 100644
index 00000000..db034967
--- /dev/null
+++ b/test/completion/tune2fs.exp
@@ -0,0 +1 @@
+assert_source_completions tune2fs
diff --git a/test/completion/xfreerdp.exp b/test/completion/xfreerdp.exp
new file mode 100644
index 00000000..5ca649a2
--- /dev/null
+++ b/test/completion/xfreerdp.exp
@@ -0,0 +1 @@
+assert_source_completions xfreerdp
diff --git a/test/completion/xmodmap.exp b/test/completion/xmodmap.exp
new file mode 100644
index 00000000..a80bb027
--- /dev/null
+++ b/test/completion/xmodmap.exp
@@ -0,0 +1 @@
+assert_source_completions xmodmap
diff --git a/test/completion/xrdb.exp b/test/completion/xrdb.exp
new file mode 100644
index 00000000..522ac311
--- /dev/null
+++ b/test/completion/xrdb.exp
@@ -0,0 +1 @@
+assert_source_completions xrdb
diff --git a/test/config/bashrc b/test/config/bashrc
index ddf06339..fd72b816 100644
--- a/test/config/bashrc
+++ b/test/config/bashrc
@@ -7,13 +7,12 @@ set -o posix
# Unset `command_not_found_handle' as defined on Debian/Ubuntu, because this
# troubles and slows down testing
unset -f command_not_found_handle
- # Set prompt to ignore current root directory; display path starting
- # from here. E.g. prompt: /fixtures/@
+ # Set fixed prompt `/@'
TESTDIR=$(pwd)
-export PS1='$(wd=$(pwd); echo ${wd#$TESTDIR}/)@'
+export PS1='/@'
export PS2='> '
# Configure readline
-export INPUTRC=$TESTDIR/config/inputrc
+export INPUTRC=$SRCDIR/config/inputrc
# When not running via cron, avoid escape junk at beginning of line from
# readline, see e.g. http://bugs.gentoo.org/246091
[ "$CRON" ] || export TERM=dummy
@@ -31,7 +30,7 @@ unset -v \
COMP_TAR_INTERNAL_PATHS
# Load bash testsuite helper functions
-. lib/library.sh
+. $SRCDIR/lib/library.sh
# Local variables:
# mode: shell-script
diff --git a/test/config/default.exp b/test/config/default.exp
index d1c04e71..1eb47a2c 100644
--- a/test/config/default.exp
+++ b/test/config/default.exp
@@ -1,23 +1,21 @@
- # Set default expect fallback routines
+# Set default expect fallback routines
expect_after {
eof {
if {[info exists test]} {
fail "$test at eof"
- } else {
+ } elseif {[info level] > 0} {
fail "[info level 1] at eof"
- }; # if
- }; # eof
+ } else {
+ fail "eof"
+ }
+ }
timeout {
if {[info exists test]} {
fail "$test at timeout"
- } else {
+ } elseif {[info level] > 0} {
fail "[info level 1] at timeout"
- }; # if
- }; # timeout
-}; # expect_after()
-
-
- # Call tool_start(), if available
-if { [info procs "${tool}_start"] != "" } {
- ${tool}_start
-}; # if
+ } else {
+ fail "timeout"
+ }
+ }
+}
diff --git a/test/fixtures/_filedir/ext/ii.E1 b/test/fixtures/_filedir/ext/ii.E1
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/ext/ii.E1
diff --git a/test/fixtures/_known_hosts_real/known_hosts b/test/fixtures/_known_hosts_real/known_hosts
index bf39e848..f655eaa3 100644
--- a/test/fixtures/_known_hosts_real/known_hosts
+++ b/test/fixtures/_known_hosts_real/known_hosts
@@ -4,3 +4,10 @@ doo
ike ssh-rsa qwerty1234/Qwerty+1234==
jub,10.0.0.1
kyl,100.0.0.2
+[10.10.0.3]:10022
+[blah]:1234
+fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555
+fe80::123:0xff:dead:beef%eth0
+1111:2222:3333:4444:5555:6666:xxxx:abab
+11xx:2222:3333:4444:5555:6666:xxxx:abab
+::42
diff --git a/test/fixtures/acroread/bar b/test/fixtures/acroread/bar
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/acroread/bar
diff --git a/test/fixtures/acroread/foo.d/.gitignore b/test/fixtures/acroread/foo.d/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/acroread/foo.d/.gitignore
diff --git a/test/fixtures/acroread/t.pdf b/test/fixtures/acroread/t.pdf
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/acroread/t.pdf
diff --git a/test/fixtures/man/man1/bar.1.bz2 b/test/fixtures/man/man1/bar.1.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/man/man1/bar.1.bz2
diff --git a/test/fixtures/man/man1/foo.1 b/test/fixtures/man/man1/foo.1
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/man/man1/foo.1
diff --git a/test/fixtures/man/man3/Bash::Completion.3pm.gz b/test/fixtures/man/man3/Bash::Completion.3pm.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/man/man3/Bash::Completion.3pm.gz
diff --git a/test/fixtures/scp/known_hosts b/test/fixtures/scp/known_hosts
index d54a04d0..2dfa4b6f 100644
--- a/test/fixtures/scp/known_hosts
+++ b/test/fixtures/scp/known_hosts
@@ -2,3 +2,4 @@
|1|def
doo
ike ssh-rsa qwerty1234/Qwerty+1234==
+[blah]:1234
diff --git a/test/fixtures/sftp/known_hosts b/test/fixtures/sftp/known_hosts
index d54a04d0..6538eb4b 100644
--- a/test/fixtures/sftp/known_hosts
+++ b/test/fixtures/sftp/known_hosts
@@ -2,3 +2,4 @@
|1|def
doo
ike ssh-rsa qwerty1234/Qwerty+1234==
+[10.10.10.10]:2222
diff --git a/test/lib/completion.exp b/test/lib/completion.exp
index ea2a3d8d..88e92d50 100644
--- a/test/lib/completion.exp
+++ b/test/lib/completion.exp
@@ -1,4 +1,4 @@
-source ${srcdir}/lib/library.exp
+source $::srcdir/lib/library.exp
proc completion_exit {} {
@@ -6,6 +6,14 @@ proc completion_exit {} {
}
+proc completion_init {test_file_name} {
+ # Call completion_start() only once
+ if {! [info exists ::BASH_VERSINFO]} {
+ completion_start
+ }
+}
+
+
proc completion_start {} {
start_interactive_test
}
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/a2ps.exp
index 796e14cc..77cd07f5 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/a2ps.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/abook.exp
index 3f4e301f..43f62729 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/abook.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/aclocal.exp b/test/lib/completions/aclocal.exp
new file mode 100644
index 00000000..da133aa8
--- /dev/null
+++ b/test/lib/completions/aclocal.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "aclocal "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/acroread.exp b/test/lib/completions/acroread.exp
index 4f11f905..f627d34e 100644
--- a/test/lib/completions/acroread.exp
+++ b/test/lib/completions/acroread.exp
@@ -1,19 +1,17 @@
proc setup {} {
save_env
- assert_bash_exec "touch fixtures/shared/default/t.pdf"; # Create temporary files
-}; # setup()
+}
proc teardown {} {
- assert_bash_exec "rm fixtures/shared/default/t.pdf"; # Remove temporary files
- assert_env_unmodified
-}; # teardown()
+ assert_env_unmodified {/OLDPWD/d}
+}
setup
-assert_complete {"bar bar.d/" foo.d/ t.pdf} "acroread fixtures/shared/default/"
+assert_complete_dir {foo.d/ t.pdf} "acroread " $::srcdir/fixtures/acroread
sync_after_int
diff --git a/test/lib/completions/add_members.exp b/test/lib/completions/add_members.exp
index 02cd762d..46c7a688 100644
--- a/test/lib/completions/add_members.exp
+++ b/test/lib/completions/add_members.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/alias.exp b/test/lib/completions/alias.exp
index e6b88d00..9dba4e62 100644
--- a/test/lib/completions/alias.exp
+++ b/test/lib/completions/alias.exp
@@ -3,13 +3,13 @@ proc setup {} {
assert_bash_exec "alias foo=bar"
assert_bash_exec "alias bar='foo foo'"
save_env
-}; # setup()
+}
proc teardown {} {
assert_bash_exec "unalias -a"; # Remove all aliases
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -34,7 +34,7 @@ expect {
-re "^alias foo\b\b\bfoo=foo\b\b\b$" { fail "$test: Wrong cursor position" }
-re /@ { unresolved "$test" }
default { unresolved "$test" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/animate.exp
index 26065d25..12314d79 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/animate.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ant.exp b/test/lib/completions/ant.exp
index 81294439..de57f24a 100644
--- a/test/lib/completions/ant.exp
+++ b/test/lib/completions/ant.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/apache2ctl.exp b/test/lib/completions/apache2ctl.exp
index e63abb16..88e53fc2 100644
--- a/test/lib/completions/apache2ctl.exp
+++ b/test/lib/completions/apache2ctl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/apt-build.exp b/test/lib/completions/apt-build.exp
index fd09d0eb..01ff04b4 100644
--- a/test/lib/completions/apt-build.exp
+++ b/test/lib/completions/apt-build.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/apt-cache.exp b/test/lib/completions/apt-cache.exp
index 5336beab..63be48a8 100644
--- a/test/lib/completions/apt-cache.exp
+++ b/test/lib/completions/apt-cache.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/apt-get.exp b/test/lib/completions/apt-get.exp
index 6bd0f3a2..66887bd0 100644
--- a/test/lib/completions/apt-get.exp
+++ b/test/lib/completions/apt-get.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/aptitude.exp b/test/lib/completions/aptitude.exp
index dde6d26e..e6e82abb 100644
--- a/test/lib/completions/aptitude.exp
+++ b/test/lib/completions/aptitude.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/arch.exp b/test/lib/completions/arch.exp
index 9f7114c4..0550c76b 100644
--- a/test/lib/completions/arch.exp
+++ b/test/lib/completions/arch.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/arpspoof.exp b/test/lib/completions/arpspoof.exp
index 7db79f50..91ef5182 100644
--- a/test/lib/completions/arpspoof.exp
+++ b/test/lib/completions/arpspoof.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/aspell.exp b/test/lib/completions/aspell.exp
index 4edeb03b..9dd5f61a 100644
--- a/test/lib/completions/aspell.exp
+++ b/test/lib/completions/aspell.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/autoconf.exp b/test/lib/completions/autoconf.exp
index 4a44b651..53b096db 100644
--- a/test/lib/completions/autoconf.exp
+++ b/test/lib/completions/autoconf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/autoheader.exp b/test/lib/completions/autoheader.exp
new file mode 100644
index 00000000..d85d4606
--- /dev/null
+++ b/test/lib/completions/autoheader.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "autoheader "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/automake.exp b/test/lib/completions/automake.exp
index cf27364a..f875da56 100644
--- a/test/lib/completions/automake.exp
+++ b/test/lib/completions/automake.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/autoreconf.exp b/test/lib/completions/autoreconf.exp
new file mode 100644
index 00000000..98808fb2
--- /dev/null
+++ b/test/lib/completions/autoreconf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "autoreconf "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/autorpm.exp b/test/lib/completions/autorpm.exp
index 99b743ca..2ae4ff80 100644
--- a/test/lib/completions/autorpm.exp
+++ b/test/lib/completions/autorpm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/autoscan.exp b/test/lib/completions/autoscan.exp
new file mode 100644
index 00000000..f75da812
--- /dev/null
+++ b/test/lib/completions/autoscan.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "autoscan "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/autoupdate.exp b/test/lib/completions/autoupdate.exp
new file mode 100644
index 00000000..c83912dd
--- /dev/null
+++ b/test/lib/completions/autoupdate.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "autoupdate "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/awk.exp b/test/lib/completions/awk.exp
index 4288adbf..260dabcc 100644
--- a/test/lib/completions/awk.exp
+++ b/test/lib/completions/awk.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/badblocks.exp b/test/lib/completions/badblocks.exp
new file mode 100644
index 00000000..d453b5bd
--- /dev/null
+++ b/test/lib/completions/badblocks.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "badblocks "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/bash.exp b/test/lib/completions/bash.exp
index 4caf58fc..bf01e76d 100644
--- a/test/lib/completions/bash.exp
+++ b/test/lib/completions/bash.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/bc.exp b/test/lib/completions/bc.exp
index c437d037..23c22b62 100644
--- a/test/lib/completions/bc.exp
+++ b/test/lib/completions/bc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/bison.exp b/test/lib/completions/bison.exp
index a3dea1e0..4bbb59fa 100644
--- a/test/lib/completions/bison.exp
+++ b/test/lib/completions/bison.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/bk.exp b/test/lib/completions/bk.exp
index 4915136e..b652e6b0 100644
--- a/test/lib/completions/bk.exp
+++ b/test/lib/completions/bk.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/brctl.exp b/test/lib/completions/brctl.exp
index d87002a2..57c9edff 100644
--- a/test/lib/completions/brctl.exp
+++ b/test/lib/completions/brctl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/btdownloadcurses.py.exp b/test/lib/completions/btdownloadcurses.py.exp
index 9dc0ba5a..71a00de7 100644
--- a/test/lib/completions/btdownloadcurses.py.exp
+++ b/test/lib/completions/btdownloadcurses.py.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/btdownloadgui.py.exp b/test/lib/completions/btdownloadgui.py.exp
index 03897a53..65f56776 100644
--- a/test/lib/completions/btdownloadgui.py.exp
+++ b/test/lib/completions/btdownloadgui.py.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/btdownloadheadless.py.exp b/test/lib/completions/btdownloadheadless.py.exp
index 69c62950..3c833bb8 100644
--- a/test/lib/completions/btdownloadheadless.py.exp
+++ b/test/lib/completions/btdownloadheadless.py.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/bzip2.exp b/test/lib/completions/bzip2.exp
index e5389a2a..2813dd0e 100644
--- a/test/lib/completions/bzip2.exp
+++ b/test/lib/completions/bzip2.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/c++.exp b/test/lib/completions/c++.exp
index 1fe4bb13..4dffb042 100644
--- a/test/lib/completions/c++.exp
+++ b/test/lib/completions/c++.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cancel.exp b/test/lib/completions/cancel.exp
index 24ca47c4..f4a03473 100644
--- a/test/lib/completions/cancel.exp
+++ b/test/lib/completions/cancel.exp
@@ -1,18 +1,18 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
# Adding a print job is successful?
-if {[assert_exec {lp -H hold fixtures/shared/default/foo} job "" "untested"]} {
+if {[assert_exec {lp -H hold $::srcdir/fixtures/shared/default/foo} job "" "untested"]} {
# Yes, adding a print-job is successful;
# Retrieve job-id, so we can cancel the job after the test
set job_id [lindex [split $job] 3]
@@ -22,7 +22,7 @@ if {[assert_exec {lp -H hold fixtures/shared/default/foo} job "" "untested"]} {
assert_complete $jobs "cancel "
# Remove/cancel the test print job
assert_exec "cancel $job_id"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/cardctl.exp b/test/lib/completions/cardctl.exp
index b5d7e88d..9df90f48 100644
--- a/test/lib/completions/cardctl.exp
+++ b/test/lib/completions/cardctl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cat.exp b/test/lib/completions/cat.exp
index 46e8775f..01b3659e 100644
--- a/test/lib/completions/cat.exp
+++ b/test/lib/completions/cat.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cc.exp b/test/lib/completions/cc.exp
index 1d63d006..eb722dea 100644
--- a/test/lib/completions/cc.exp
+++ b/test/lib/completions/cc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cd.exp b/test/lib/completions/cd.exp
index 58233575..55bae158 100644
--- a/test/lib/completions/cd.exp
+++ b/test/lib/completions/cd.exp
@@ -1,18 +1,18 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
set test "Tab should complete"
-assert_complete {"bar bar.d/" foo.d/} "cd fixtures/shared/default/" $test
+assert_complete {"bar bar.d/" foo.d/} "cd $::srcdir/fixtures/shared/default/" $test
sync_after_int
@@ -20,16 +20,16 @@ sync_after_int
set test "Tab should complete cd at cursor position"
# Try completion
-set cmd "cd fixtures/shared/default/foo"
+set cmd "cd $::srcdir/fixtures/shared/default/foo"
append cmd \002\002\002; # \002 = ^B = Move cursor left in bash emacs mode
#append cmd \033\0133D; # Escape-[-D = Cursor left
send "$cmd\t"
expect {
- -re "cd fixtures/shared/default/foo\b\b\b\r\n(\.svn/ +|)bar bar.d/ +foo.d/ *(\.svn/ *|)\r\n/@cd fixtures/shared/default/foo\b\b\b$" { pass "$test" }
- -re "^cd fixtures/shared/default/foo\b\b\bfoo.d/foo\b\b\b$" { fail "$test: Wrong cursor position" }
+ -re "cd $::srcdir/fixtures/shared/default/foo\b\b\b\r\n(\.svn/ +|)bar bar.d/ +foo.d/ *(\.svn/ *|)\r\n/@cd $::srcdir/fixtures/shared/default/foo\b\b\b$" { pass "$test" }
+ -re "^cd $::srcdir/fixtures/shared/default/foo\b\b\bfoo.d/foo\b\b\b$" { fail "$test: Wrong cursor position" }
-re /@ { unresolved "$test at prompt" }
default { unresolved "$test" }
-}; # expect
+}
sync_after_int
@@ -37,11 +37,13 @@ sync_after_int
set test "Tab should complete CDPATH"
# Set CDPATH
+assert_bash_exec "declare -p CDPATH &>/dev/null && OLDCDPATH=\$CDPATH || :"
assert_bash_exec "CDPATH=\$PWD";
-assert_complete "fixtures/shared/default/foo.d/" "cd fixtures/shared/default/fo" $test
+assert_complete "$::srcdir/fixtures/shared/default/foo.d/" \
+ "cd $::srcdir/fixtures/shared/default/fo" $test -nospace -expect-cmd-minus fo
sync_after_int
# Reset CDPATH
-assert_bash_exec "unset CDPATH"
+assert_bash_exec "declare -p OLDCDPATH &>/dev/null && CDPATH=\$OLDCDPATH || unset CDPATH && unset OLDCDPATH"
teardown
diff --git a/test/lib/completions/cdrecord.exp b/test/lib/completions/cdrecord.exp
index d369f79d..192d2ded 100644
--- a/test/lib/completions/cdrecord.exp
+++ b/test/lib/completions/cdrecord.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/change_pw.exp b/test/lib/completions/change_pw.exp
index ca9bcdbd..28301941 100644
--- a/test/lib/completions/change_pw.exp
+++ b/test/lib/completions/change_pw.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/check_db.exp b/test/lib/completions/check_db.exp
index ca59a715..fe34ead2 100644
--- a/test/lib/completions/check_db.exp
+++ b/test/lib/completions/check_db.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/check_perms.exp b/test/lib/completions/check_perms.exp
index a58995b0..b40b78fc 100644
--- a/test/lib/completions/check_perms.exp
+++ b/test/lib/completions/check_perms.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/chgrp.exp b/test/lib/completions/chgrp.exp
index 8dfeea79..e9238bde 100644
--- a/test/lib/completions/chgrp.exp
+++ b/test/lib/completions/chgrp.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/chkconfig.exp b/test/lib/completions/chkconfig.exp
index e7469b34..dae3b3bd 100644
--- a/test/lib/completions/chkconfig.exp
+++ b/test/lib/completions/chkconfig.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/chown.exp b/test/lib/completions/chown.exp
index 953b2b02..bc1a8c7f 100644
--- a/test/lib/completions/chown.exp
+++ b/test/lib/completions/chown.exp
@@ -1,10 +1,12 @@
proc setup {} {
+ # fake root command to get all users/groups completed at least for now
+ assert_bash_exec {root_command=sudo}
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -38,12 +40,11 @@ if {!$failed_find_unique_completion} {
assert_complete $fulluser:$fullgroup "chown $fulluser:$partgroup"
sync_after_int
- # One slash should work correctly (doubled here for tcl).
- assert_complete $fulluser\\:$fullgroup "chown $fulluser\\:$partgroup"
+ assert_complete "dot.user:$fullgroup" "chown dot.user:$partgroup"
sync_after_int
foreach prefix {
- "funky\\ user:" "funky\\ user\\:" "funky.user:" "funky\\.user:" "fu\\ nky.user\\:"
+ "funky\\ user:" "funky.user:" "funky\\.user:" "fu\\ nky.user:"
"f\\ o\\ o\\.\\bar:" "foo\\_b\\ a\\.r\\ :"
} {
set test "Check preserve special chars in $prefix$partgroup<TAB>"
diff --git a/test/lib/completions/chsh.exp b/test/lib/completions/chsh.exp
index 99262a2c..a26ac93f 100644
--- a/test/lib/completions/chsh.exp
+++ b/test/lib/completions/chsh.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ci.exp b/test/lib/completions/ci.exp
index 09105eec..15ef2ecc 100644
--- a/test/lib/completions/ci.exp
+++ b/test/lib/completions/ci.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/civclient.exp b/test/lib/completions/civclient.exp
index 8159c2bc..c0047468 100644
--- a/test/lib/completions/civclient.exp
+++ b/test/lib/completions/civclient.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/civserver.exp b/test/lib/completions/civserver.exp
index df459688..3739f50e 100644
--- a/test/lib/completions/civserver.exp
+++ b/test/lib/completions/civserver.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cksfv.exp b/test/lib/completions/cksfv.exp
index a40a5023..2b9be04c 100644
--- a/test/lib/completions/cksfv.exp
+++ b/test/lib/completions/cksfv.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cleanarch.exp b/test/lib/completions/cleanarch.exp
index e3145e81..a5f3bfe6 100644
--- a/test/lib/completions/cleanarch.exp
+++ b/test/lib/completions/cleanarch.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/clisp.exp b/test/lib/completions/clisp.exp
index 2bc599ac..dfbad4f3 100644
--- a/test/lib/completions/clisp.exp
+++ b/test/lib/completions/clisp.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/clone_member.exp b/test/lib/completions/clone_member.exp
index 34b4db57..d83d73bc 100644
--- a/test/lib/completions/clone_member.exp
+++ b/test/lib/completions/clone_member.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/co.exp b/test/lib/completions/co.exp
index 49fe3a64..215268b6 100644
--- a/test/lib/completions/co.exp
+++ b/test/lib/completions/co.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/composite.exp b/test/lib/completions/composite.exp
index e39ce72f..aba9af3b 100644
--- a/test/lib/completions/composite.exp
+++ b/test/lib/completions/composite.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/config_list.exp b/test/lib/completions/config_list.exp
index 5246c860..27699239 100644
--- a/test/lib/completions/config_list.exp
+++ b/test/lib/completions/config_list.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/configure.exp b/test/lib/completions/configure.exp
index 74afba1b..b4399cb1 100644
--- a/test/lib/completions/configure.exp
+++ b/test/lib/completions/configure.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/convert.exp b/test/lib/completions/convert.exp
index d8a77e35..07032040 100644
--- a/test/lib/completions/convert.exp
+++ b/test/lib/completions/convert.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cowsay.exp b/test/lib/completions/cowsay.exp
index dfbefe1a..382f400f 100644
--- a/test/lib/completions/cowsay.exp
+++ b/test/lib/completions/cowsay.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cp.exp b/test/lib/completions/cp.exp
index 9fe46537..703bf263 100644
--- a/test/lib/completions/cp.exp
+++ b/test/lib/completions/cp.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cpio.exp b/test/lib/completions/cpio.exp
index b02f2719..93f6f3c1 100644
--- a/test/lib/completions/cpio.exp
+++ b/test/lib/completions/cpio.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/createdb.exp b/test/lib/completions/createdb.exp
index 1e5cdbe7..aafff1b6 100644
--- a/test/lib/completions/createdb.exp
+++ b/test/lib/completions/createdb.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/crontab.exp b/test/lib/completions/crontab.exp
new file mode 100644
index 00000000..18e2269f
--- /dev/null
+++ b/test/lib/completions/crontab.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "crontab "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cryptsetup.exp b/test/lib/completions/cryptsetup.exp
index e94c3ac1..4c20bc5d 100644
--- a/test/lib/completions/cryptsetup.exp
+++ b/test/lib/completions/cryptsetup.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/csplit.exp b/test/lib/completions/csplit.exp
index 3a66a627..87b89dea 100644
--- a/test/lib/completions/csplit.exp
+++ b/test/lib/completions/csplit.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cut.exp b/test/lib/completions/cut.exp
index b9bcf6c5..edb558ea 100644
--- a/test/lib/completions/cut.exp
+++ b/test/lib/completions/cut.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/cvs.exp b/test/lib/completions/cvs.exp
index 2a26da8e..3b2643d3 100644
--- a/test/lib/completions/cvs.exp
+++ b/test/lib/completions/cvs.exp
@@ -1,7 +1,7 @@
proc setup {} {
save_env
- assert_bash_exec {OLDHOME=$HOME ; HOME=$TESTDIR/fixtures/cvs}
-}; # setup()
+ assert_bash_exec {OLDHOME=$HOME ; HOME=$SRCDIR/fixtures/cvs}
+}
proc teardown {} {
@@ -9,7 +9,7 @@ proc teardown {} {
assert_env_unmodified {
/OLDHOME=/d
}
-}; # teardown()
+}
setup
@@ -27,7 +27,7 @@ send "$cmd\t"
expect {
-re "^$cmd\r\n.*:pserver:.*\r\n/@$cmd:pserver:.*$" { pass "$test" }
default { fail "$test" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/cvsps.exp b/test/lib/completions/cvsps.exp
index 1fd4a0a9..6cf95ac1 100644
--- a/test/lib/completions/cvsps.exp
+++ b/test/lib/completions/cvsps.exp
@@ -1,7 +1,7 @@
proc setup {} {
save_env
- assert_bash_exec {OLDHOME=$HOME ; HOME=$TESTDIR/fixtures/cvs}
-}; # setup()
+ assert_bash_exec {OLDHOME=$HOME ; HOME=$SRCDIR/fixtures/cvs}
+}
proc teardown {} {
@@ -9,7 +9,7 @@ proc teardown {} {
assert_env_unmodified {
/OLDHOME=/d
}
-}; # teardown()
+}
setup
@@ -27,7 +27,7 @@ send "$cmd\t"
expect {
-re "^$cmd\r\n.*:pserver:.*\r\n/@$cmd:pserver:.*$" { pass "$test" }
default { fail "$test" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/date.exp b/test/lib/completions/date.exp
index 9d75f5f3..ee970cf7 100644
--- a/test/lib/completions/date.exp
+++ b/test/lib/completions/date.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dcop.exp b/test/lib/completions/dcop.exp
index 6ed800c5..1e27346b 100644
--- a/test/lib/completions/dcop.exp
+++ b/test/lib/completions/dcop.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {dcop} words]} {
assert_complete $words "dcop "
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/dd.exp b/test/lib/completions/dd.exp
index 400dd143..e02e037c 100644
--- a/test/lib/completions/dd.exp
+++ b/test/lib/completions/dd.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -24,7 +24,7 @@ expect -ex "$cmd"
expect {
-re "^=$" { pass $test }
-re {^\\=$} { xfail $test }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/df.exp b/test/lib/completions/df.exp
index 487d70a9..acf212a9 100644
--- a/test/lib/completions/df.exp
+++ b/test/lib/completions/df.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dhclient.exp b/test/lib/completions/dhclient.exp
index 42c14c82..6caff5fc 100644
--- a/test/lib/completions/dhclient.exp
+++ b/test/lib/completions/dhclient.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dict.exp b/test/lib/completions/dict.exp
index 32fb4988..402e0c5c 100644
--- a/test/lib/completions/dict.exp
+++ b/test/lib/completions/dict.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/diff.exp b/test/lib/completions/diff.exp
index c009f640..918bf7fd 100644
--- a/test/lib/completions/diff.exp
+++ b/test/lib/completions/diff.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dir.exp b/test/lib/completions/dir.exp
index 6e20d37d..c9f61cd5 100644
--- a/test/lib/completions/dir.exp
+++ b/test/lib/completions/dir.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/display.exp b/test/lib/completions/display.exp
index 9a9d6901..e9fe766a 100644
--- a/test/lib/completions/display.exp
+++ b/test/lib/completions/display.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dnsspoof.exp b/test/lib/completions/dnsspoof.exp
index 3223a349..4aefb956 100644
--- a/test/lib/completions/dnsspoof.exp
+++ b/test/lib/completions/dnsspoof.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dpkg-deb.exp b/test/lib/completions/dpkg-deb.exp
index c8656610..37ece08d 100644
--- a/test/lib/completions/dpkg-deb.exp
+++ b/test/lib/completions/dpkg-deb.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dpkg-reconfigure.exp b/test/lib/completions/dpkg-reconfigure.exp
index 267594be..0212666b 100644
--- a/test/lib/completions/dpkg-reconfigure.exp
+++ b/test/lib/completions/dpkg-reconfigure.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dpkg-source.exp b/test/lib/completions/dpkg-source.exp
index a21eff45..a42759b9 100644
--- a/test/lib/completions/dpkg-source.exp
+++ b/test/lib/completions/dpkg-source.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dpkg.exp b/test/lib/completions/dpkg.exp
index 2bd1fb6e..f358e172 100644
--- a/test/lib/completions/dpkg.exp
+++ b/test/lib/completions/dpkg.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -20,7 +20,7 @@ sync_after_int
# Build list of installed packages
if {[assert_exec {dpkg --get-selections | command grep \[\[:space:\]\]install$ | cut -f1} packages]} {
assert_complete $packages "dpkg -L "
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/dropdb.exp b/test/lib/completions/dropdb.exp
index e78a2ba7..8f2d5bfb 100644
--- a/test/lib/completions/dropdb.exp
+++ b/test/lib/completions/dropdb.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dselect.exp b/test/lib/completions/dselect.exp
index f6257294..634db05e 100644
--- a/test/lib/completions/dselect.exp
+++ b/test/lib/completions/dselect.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dsniff.exp b/test/lib/completions/dsniff.exp
index a0cc43ac..cb8912b6 100644
--- a/test/lib/completions/dsniff.exp
+++ b/test/lib/completions/dsniff.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/du.exp b/test/lib/completions/du.exp
index d1ffa8ca..6ddeb9b2 100644
--- a/test/lib/completions/du.exp
+++ b/test/lib/completions/du.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dumpdb.exp b/test/lib/completions/dumpdb.exp
index 240214b3..5b617b11 100644
--- a/test/lib/completions/dumpdb.exp
+++ b/test/lib/completions/dumpdb.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/dumpe2fs.exp b/test/lib/completions/dumpe2fs.exp
new file mode 100644
index 00000000..e935c504
--- /dev/null
+++ b/test/lib/completions/dumpe2fs.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "dumpe2fs "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/e2freefrag.exp b/test/lib/completions/e2freefrag.exp
new file mode 100644
index 00000000..1530c9c9
--- /dev/null
+++ b/test/lib/completions/e2freefrag.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "e2freefrag "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/e2label.exp b/test/lib/completions/e2label.exp
new file mode 100644
index 00000000..8ae7f443
--- /dev/null
+++ b/test/lib/completions/e2label.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "e2label "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/enscript.exp b/test/lib/completions/enscript.exp
index 7fefabdd..c859b50f 100644
--- a/test/lib/completions/enscript.exp
+++ b/test/lib/completions/enscript.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/env.exp b/test/lib/completions/env.exp
index f03f5395..4f213748 100644
--- a/test/lib/completions/env.exp
+++ b/test/lib/completions/env.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {env --help} "" "" "unsupported"]} {
assert_complete_any "env --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/ether-wake.exp b/test/lib/completions/ether-wake.exp
new file mode 100644
index 00000000..fe1aa174
--- /dev/null
+++ b/test/lib/completions/ether-wake.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "ether-wake "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/evince.exp b/test/lib/completions/evince.exp
index 22279a26..204467a1 100644
--- a/test/lib/completions/evince.exp
+++ b/test/lib/completions/evince.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/OLDPWD=/d}
-}; # teardown()
+}
setup
@@ -26,7 +26,7 @@ set files {
.tga .TGA .tif .TIF .tiff .TIFF
.xpm .XPM .xwd .XWD
}
-assert_complete_dir $files "evince " "fixtures/evince"
+assert_complete_dir $files "evince " "$::srcdir/fixtures/evince"
sync_after_int
diff --git a/test/lib/completions/expand.exp b/test/lib/completions/expand.exp
index d5cd6b17..76b6eafa 100644
--- a/test/lib/completions/expand.exp
+++ b/test/lib/completions/expand.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {expand --help} "" "" "unsupported"]} {
assert_complete_any "expand --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/filefrag.exp b/test/lib/completions/filefrag.exp
new file mode 100644
index 00000000..fa80cd05
--- /dev/null
+++ b/test/lib/completions/filefrag.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "filefrag "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/filesnarf.exp b/test/lib/completions/filesnarf.exp
index 53cf01e4..03755056 100644
--- a/test/lib/completions/filesnarf.exp
+++ b/test/lib/completions/filesnarf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/find.exp b/test/lib/completions/find.exp
index 4b1728dc..9acda648 100644
--- a/test/lib/completions/find.exp
+++ b/test/lib/completions/find.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/OLDPWD=/d}
-}; # teardown()
+}
setup
@@ -41,7 +41,7 @@ sync_after_int
set test "-wholename should complete files/dirs"
-set dir fixtures/shared/default
+set dir $::srcdir/fixtures/shared/default
set files [split [exec bash -c "cd $dir && ls -p"] "\n"]
assert_complete_dir $files "find -wholename " $dir
@@ -50,28 +50,26 @@ sync_after_int
set test "-uid should complete uids"
- # Complete
set cmd "find -uid "
send "$cmd\t"
expect {
-re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
set test "-gid should complete gids"
- # Complete
set cmd "find -gid "
send "$cmd\t"
expect {
-re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/find_member.exp b/test/lib/completions/find_member.exp
index 58fac7d2..55672091 100644
--- a/test/lib/completions/find_member.exp
+++ b/test/lib/completions/find_member.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp
index 30f2b080..70e3ed2c 100644
--- a/test/lib/completions/finger.exp
+++ b/test/lib/completions/finger.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -16,7 +16,7 @@ set test "Tab should complete usernames"
set users {}
foreach u [exec bash -c "compgen -A user"] {
lappend users $u
-}; # foreach
+}
assert_complete $users "finger " $test
@@ -24,7 +24,7 @@ sync_after_int
set test "Tab should complete partial username"
-assert_complete_partial [exec bash -c "compgen -A user"] "finger"
+assert_complete_partial [exec bash -c "compgen -A user"] "finger" -nospace
sync_after_int
@@ -39,15 +39,15 @@ set hosts {}
set char ""
foreach h [get_known_hosts] {
set first [string range $h 0 0]
- if {$char == "" && [string first $first $COMP_WORDBREAKS] == -1} {set char $first}
+ if {$char == "" && [string first $first $::COMP_WORDBREAKS] == -1} {set char $first}
if {$char != ""} {
# Only append unique hostnames starting with $char
if {$first == $char && [lsearch -exact $hosts "test@$h"] == -1} {
# Prefix hosts with username 'test@'
lappend hosts "test@$h"
- }; # if
- }; # if
-}; # foreach
+ }
+ }
+}
assert_complete $hosts "finger test@$char" $test
diff --git a/test/lib/completions/fmt.exp b/test/lib/completions/fmt.exp
index 28570682..7d3cc17f 100644
--- a/test/lib/completions/fmt.exp
+++ b/test/lib/completions/fmt.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {fmt --help} "" "" "unsupported"]} {
assert_complete_any "fmt -"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/fold.exp b/test/lib/completions/fold.exp
index a5230b03..f447f08b 100644
--- a/test/lib/completions/fold.exp
+++ b/test/lib/completions/fold.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {fold --help} "" "" "unsupported"]} {
assert_complete_any "fold --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/freerdp.exp b/test/lib/completions/freerdp.exp
new file mode 100644
index 00000000..be61d459
--- /dev/null
+++ b/test/lib/completions/freerdp.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "xfreerdp"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/g++.exp b/test/lib/completions/g++.exp
index 4dc2591a..4dbe73f4 100644
--- a/test/lib/completions/g++.exp
+++ b/test/lib/completions/g++.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/g4.exp b/test/lib/completions/g4.exp
index 203de061..7d575f10 100644
--- a/test/lib/completions/g4.exp
+++ b/test/lib/completions/g4.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/g77.exp b/test/lib/completions/g77.exp
index 8802aca9..e23745b7 100644
--- a/test/lib/completions/g77.exp
+++ b/test/lib/completions/g77.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gcc.exp b/test/lib/completions/gcc.exp
index 8e52a120..00097cc2 100644
--- a/test/lib/completions/gcc.exp
+++ b/test/lib/completions/gcc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gcj.exp b/test/lib/completions/gcj.exp
index db52d59a..cde07700 100644
--- a/test/lib/completions/gcj.exp
+++ b/test/lib/completions/gcj.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gcl.exp b/test/lib/completions/gcl.exp
index 7cead846..1846d0d1 100644
--- a/test/lib/completions/gcl.exp
+++ b/test/lib/completions/gcl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gdb.exp b/test/lib/completions/gdb.exp
index 982f0878..2e389edb 100644
--- a/test/lib/completions/gdb.exp
+++ b/test/lib/completions/gdb.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/genaliases.exp b/test/lib/completions/genaliases.exp
index 064eb386..bb4d5e0e 100644
--- a/test/lib/completions/genaliases.exp
+++ b/test/lib/completions/genaliases.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/getent.exp b/test/lib/completions/getent.exp
index 121f3b38..6500b22d 100644
--- a/test/lib/completions/getent.exp
+++ b/test/lib/completions/getent.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gkrellm.exp b/test/lib/completions/gkrellm.exp
index f8b0dd4d..009770fc 100644
--- a/test/lib/completions/gkrellm.exp
+++ b/test/lib/completions/gkrellm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gmplayer.exp b/test/lib/completions/gmplayer.exp
index d9032698..a110cb2f 100644
--- a/test/lib/completions/gmplayer.exp
+++ b/test/lib/completions/gmplayer.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gnatmake.exp b/test/lib/completions/gnatmake.exp
index 902aa062..bad4da33 100644
--- a/test/lib/completions/gnatmake.exp
+++ b/test/lib/completions/gnatmake.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gpc.exp b/test/lib/completions/gpc.exp
index 6c4d0383..71eddacc 100644
--- a/test/lib/completions/gpc.exp
+++ b/test/lib/completions/gpc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gperf.exp b/test/lib/completions/gperf.exp
index aa24333e..1cf77678 100644
--- a/test/lib/completions/gperf.exp
+++ b/test/lib/completions/gperf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gpg.exp b/test/lib/completions/gpg.exp
index 29fd2244..ea6805fa 100644
--- a/test/lib/completions/gpg.exp
+++ b/test/lib/completions/gpg.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gprof.exp b/test/lib/completions/gprof.exp
index 592786af..996a1efd 100644
--- a/test/lib/completions/gprof.exp
+++ b/test/lib/completions/gprof.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {gprof --help} "" "" "unsupported"]} {
assert_complete_any "gprof --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/grep.exp b/test/lib/completions/grep.exp
index 3814df71..c94ae727 100644
--- a/test/lib/completions/grep.exp
+++ b/test/lib/completions/grep.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/growisofs.exp b/test/lib/completions/growisofs.exp
new file mode 100644
index 00000000..0f2a0ec7
--- /dev/null
+++ b/test/lib/completions/growisofs.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "growisofs "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/grub.exp b/test/lib/completions/grub.exp
index 9578e789..b88d1f26 100644
--- a/test/lib/completions/grub.exp
+++ b/test/lib/completions/grub.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/gzip.exp b/test/lib/completions/gzip.exp
index f212c61a..32acf428 100644
--- a/test/lib/completions/gzip.exp
+++ b/test/lib/completions/gzip.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -19,7 +19,7 @@ expect {
-re "^$cmd\r\n.*$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/hcitool.exp b/test/lib/completions/hcitool.exp
index 9283adff..e6ae0032 100644
--- a/test/lib/completions/hcitool.exp
+++ b/test/lib/completions/hcitool.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/head.exp b/test/lib/completions/head.exp
index 0d4f6a20..7edb8a1b 100644
--- a/test/lib/completions/head.exp
+++ b/test/lib/completions/head.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {head --help} "" "" "unsupported"]} {
assert_complete_any "head --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/hping2.exp b/test/lib/completions/hping2.exp
new file mode 100644
index 00000000..8919626d
--- /dev/null
+++ b/test/lib/completions/hping2.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "hping2 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/iconv.exp b/test/lib/completions/iconv.exp
index 420e923c..dcce330f 100644
--- a/test/lib/completions/iconv.exp
+++ b/test/lib/completions/iconv.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/id.exp b/test/lib/completions/id.exp
index 155af52c..b03ee721 100644
--- a/test/lib/completions/id.exp
+++ b/test/lib/completions/id.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/identify.exp b/test/lib/completions/identify.exp
index 8f38ae47..3347c5cd 100644
--- a/test/lib/completions/identify.exp
+++ b/test/lib/completions/identify.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ifdown.exp b/test/lib/completions/ifdown.exp
index 68225bb9..7849f3f7 100644
--- a/test/lib/completions/ifdown.exp
+++ b/test/lib/completions/ifdown.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/iftop.exp b/test/lib/completions/iftop.exp
new file mode 100644
index 00000000..12941610
--- /dev/null
+++ b/test/lib/completions/iftop.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "iftop "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ifup.exp b/test/lib/completions/ifup.exp
index 9d717178..2c1c010e 100644
--- a/test/lib/completions/ifup.exp
+++ b/test/lib/completions/ifup.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/indent.exp b/test/lib/completions/indent.exp
index e8fc32b1..5c5bb1c7 100644
--- a/test/lib/completions/indent.exp
+++ b/test/lib/completions/indent.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/info.exp b/test/lib/completions/info.exp
index ed769f1a..e7c79e6e 100644
--- a/test/lib/completions/info.exp
+++ b/test/lib/completions/info.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/inject.exp b/test/lib/completions/inject.exp
index 7c093146..4f95be23 100644
--- a/test/lib/completions/inject.exp
+++ b/test/lib/completions/inject.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/insmod.exp b/test/lib/completions/insmod.exp
index 8e83f0b4..a312c894 100644
--- a/test/lib/completions/insmod.exp
+++ b/test/lib/completions/insmod.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/invoke-rc.d.exp b/test/lib/completions/invoke-rc.d.exp
index 4dc9f1d8..d217d17e 100644
--- a/test/lib/completions/invoke-rc.d.exp
+++ b/test/lib/completions/invoke-rc.d.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ip.exp b/test/lib/completions/ip.exp
new file mode 100644
index 00000000..8f45f6a3
--- /dev/null
+++ b/test/lib/completions/ip.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "ip "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ipmitool.exp b/test/lib/completions/ipmitool.exp
new file mode 100644
index 00000000..aa18e3ff
--- /dev/null
+++ b/test/lib/completions/ipmitool.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "ipmitool "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ipsec.exp b/test/lib/completions/ipsec.exp
index 15617a16..74ef638c 100644
--- a/test/lib/completions/ipsec.exp
+++ b/test/lib/completions/ipsec.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ipv6calc.exp b/test/lib/completions/ipv6calc.exp
index 74ce95f7..42201f0c 100644
--- a/test/lib/completions/ipv6calc.exp
+++ b/test/lib/completions/ipv6calc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/irb.exp b/test/lib/completions/irb.exp
index 81bea6d2..720edfdf 100644
--- a/test/lib/completions/irb.exp
+++ b/test/lib/completions/irb.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/iscsiadm.exp b/test/lib/completions/iscsiadm.exp
new file mode 100644
index 00000000..104e7c4e
--- /dev/null
+++ b/test/lib/completions/iscsiadm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "iscsiadm --mode "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/isql.exp b/test/lib/completions/isql.exp
index 87e16bca..ca40faca 100644
--- a/test/lib/completions/isql.exp
+++ b/test/lib/completions/isql.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/ODBCINI=/d}
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/iwconfig.exp b/test/lib/completions/iwconfig.exp
index f09719d7..82ae11f3 100644
--- a/test/lib/completions/iwconfig.exp
+++ b/test/lib/completions/iwconfig.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/iwlist.exp b/test/lib/completions/iwlist.exp
index 80a2c367..43c919ef 100644
--- a/test/lib/completions/iwlist.exp
+++ b/test/lib/completions/iwlist.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/iwpriv.exp b/test/lib/completions/iwpriv.exp
index f3102cc5..86b1ee95 100644
--- a/test/lib/completions/iwpriv.exp
+++ b/test/lib/completions/iwpriv.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/iwspy.exp b/test/lib/completions/iwspy.exp
index 5fa0bee5..2894ca4e 100644
--- a/test/lib/completions/iwspy.exp
+++ b/test/lib/completions/iwspy.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/jar.exp b/test/lib/completions/jar.exp
index 0e11f684..d2cb476b 100644
--- a/test/lib/completions/jar.exp
+++ b/test/lib/completions/jar.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/jarsigner.exp b/test/lib/completions/jarsigner.exp
index 075e0263..7ea7cb2e 100644
--- a/test/lib/completions/jarsigner.exp
+++ b/test/lib/completions/jarsigner.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/java.exp b/test/lib/completions/java.exp
index 14610b2f..842501d2 100644
--- a/test/lib/completions/java.exp
+++ b/test/lib/completions/java.exp
@@ -1,12 +1,12 @@
proc setup {} {
- assert_bash_exec {CLASSPATH=$TESTDIR/fixtures/java/a:$TESTDIR/fixtures/java/bashcomp.jar}
+ assert_bash_exec {CLASSPATH=$SRCDIR/fixtures/java/a:$SRCDIR/fixtures/java/bashcomp.jar}
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -25,7 +25,7 @@ sync_after_int
assert_complete "bashcomp.jarred toplevel" \
- "java -cp fixtures/java/bashcomp.jar "
+ "java -cp $::srcdir/fixtures/java/bashcomp.jar "
sync_after_int
@@ -37,7 +37,7 @@ assert_no_complete "java -cp \"\" "
sync_after_int
-assert_complete "a/ bashcomp.jar" "java -jar fixtures/java/"
+assert_complete "a/ bashcomp.jar" "java -jar $::srcdir/fixtures/java/"
sync_after_int
diff --git a/test/lib/completions/javac.exp b/test/lib/completions/javac.exp
index 6013de11..948fe8c8 100644
--- a/test/lib/completions/javac.exp
+++ b/test/lib/completions/javac.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/javadoc.exp b/test/lib/completions/javadoc.exp
index 40c922ca..0af8a3da 100644
--- a/test/lib/completions/javadoc.exp
+++ b/test/lib/completions/javadoc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/javaws.exp b/test/lib/completions/javaws.exp
new file mode 100644
index 00000000..cb29c65a
--- /dev/null
+++ b/test/lib/completions/javaws.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "javaws "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/k3b.exp b/test/lib/completions/k3b.exp
index 86942d67..cde14b86 100644
--- a/test/lib/completions/k3b.exp
+++ b/test/lib/completions/k3b.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/kdvi.exp b/test/lib/completions/kdvi.exp
index 0196049a..fa993f5e 100644
--- a/test/lib/completions/kdvi.exp
+++ b/test/lib/completions/kdvi.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/OLDPWD=/d}
-}; # teardown()
+}
setup
@@ -18,7 +18,7 @@ set files {
foo/
.dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz .DVI.gz .dvi.Z .DVI.Z
}
-assert_complete_dir $files "kdvi " "fixtures/kdvi"
+assert_complete_dir $files "kdvi " "$::srcdir/fixtures/kdvi"
sync_after_int
diff --git a/test/lib/completions/kill.exp b/test/lib/completions/kill.exp
index ca02650c..1e80fe69 100644
--- a/test/lib/completions/kill.exp
+++ b/test/lib/completions/kill.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/killall.exp b/test/lib/completions/killall.exp
index 763c8e7d..ae8b3d60 100644
--- a/test/lib/completions/killall.exp
+++ b/test/lib/completions/killall.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/kldload.exp b/test/lib/completions/kldload.exp
index 0493a10a..a1d87c97 100644
--- a/test/lib/completions/kldload.exp
+++ b/test/lib/completions/kldload.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/kldunload.exp b/test/lib/completions/kldunload.exp
index 192159a5..476c5104 100644
--- a/test/lib/completions/kldunload.exp
+++ b/test/lib/completions/kldunload.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/kpdf.exp b/test/lib/completions/kpdf.exp
index 010abcfb..6f0feb68 100644
--- a/test/lib/completions/kpdf.exp
+++ b/test/lib/completions/kpdf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/OLDPWD=/d}
-}; # teardown()
+}
setup
@@ -17,7 +17,7 @@ setup
set files {
foo/ .eps .ps .EPS .PS .pdf .PDF
}
-assert_complete_dir $files "kpdf " "fixtures/kpdf"
+assert_complete_dir $files "kpdf " "$::srcdir/fixtures/kpdf"
sync_after_int
diff --git a/test/lib/completions/kplayer.exp b/test/lib/completions/kplayer.exp
index 34c9b3bf..4fdfa672 100644
--- a/test/lib/completions/kplayer.exp
+++ b/test/lib/completions/kplayer.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/larch.exp b/test/lib/completions/larch.exp
index 076016f2..cefcbe02 100644
--- a/test/lib/completions/larch.exp
+++ b/test/lib/completions/larch.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ld.exp b/test/lib/completions/ld.exp
index 60377991..ee660fcb 100644
--- a/test/lib/completions/ld.exp
+++ b/test/lib/completions/ld.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ldd.exp b/test/lib/completions/ldd.exp
index e45d1df7..1c3239c7 100644
--- a/test/lib/completions/ldd.exp
+++ b/test/lib/completions/ldd.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/less.exp b/test/lib/completions/less.exp
index 269c9b5c..78d6ef14 100644
--- a/test/lib/completions/less.exp
+++ b/test/lib/completions/less.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lftp.exp b/test/lib/completions/lftp.exp
index a49a1935..bb219650 100644
--- a/test/lib/completions/lftp.exp
+++ b/test/lib/completions/lftp.exp
@@ -1,12 +1,12 @@
proc setup {} {
- assert_bash_exec {HOME=$TESTDIR/fixtures/lftp}
+ assert_bash_exec {HOME=$SRCDIR/fixtures/lftp}
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lftpget.exp b/test/lib/completions/lftpget.exp
index 7d80216e..0eadb6e9 100644
--- a/test/lib/completions/lftpget.exp
+++ b/test/lib/completions/lftpget.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lilo.exp b/test/lib/completions/lilo.exp
index 505a1470..36ea2c66 100644
--- a/test/lib/completions/lilo.exp
+++ b/test/lib/completions/lilo.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/links.exp b/test/lib/completions/links.exp
index 9f4896aa..4124e2f4 100644
--- a/test/lib/completions/links.exp
+++ b/test/lib/completions/links.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lisp.exp b/test/lib/completions/lisp.exp
index 21663628..5131b45d 100644
--- a/test/lib/completions/lisp.exp
+++ b/test/lib/completions/lisp.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/list_admins.exp b/test/lib/completions/list_admins.exp
index e1c9c4dd..3b412136 100644
--- a/test/lib/completions/list_admins.exp
+++ b/test/lib/completions/list_admins.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/list_lists.exp b/test/lib/completions/list_lists.exp
index 789ab1a8..a62dca25 100644
--- a/test/lib/completions/list_lists.exp
+++ b/test/lib/completions/list_lists.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/list_members.exp b/test/lib/completions/list_members.exp
index c93b53d7..8c74cdfb 100644
--- a/test/lib/completions/list_members.exp
+++ b/test/lib/completions/list_members.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/list_owners.exp b/test/lib/completions/list_owners.exp
index c96e0229..65e3ba8e 100644
--- a/test/lib/completions/list_owners.exp
+++ b/test/lib/completions/list_owners.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ln.exp b/test/lib/completions/ln.exp
index 34786071..61405020 100644
--- a/test/lib/completions/ln.exp
+++ b/test/lib/completions/ln.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/look.exp b/test/lib/completions/look.exp
index 53a3c464..8f93db24 100644
--- a/test/lib/completions/look.exp
+++ b/test/lib/completions/look.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {look foo | grep ^foo} words]} {
assert_complete $words "look foo"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/lrzip.exp b/test/lib/completions/lrzip.exp
new file mode 100644
index 00000000..97bc1235
--- /dev/null
+++ b/test/lib/completions/lrzip.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "lrzip "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ls.exp b/test/lib/completions/ls.exp
index db2d41d3..0d16ec03 100644
--- a/test/lib/completions/ls.exp
+++ b/test/lib/completions/ls.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,29 @@ setup
if {[assert_exec {ls --help} "" "" "unsupported"]} {
assert_complete_any "ls --"
-}; # if
+}
+
+
+sync_after_int
+
+
+set test "~part should complete to ~full/ if existing dir"
+# Create list of users, having existing home dir
+assert_bash_exec {for u in $(compgen -u); do \
+ eval test -d ~$u && echo $u; unset u; done} {} /@ users
+find_unique_completion_pair $users part full
+assert_complete "~$full/" "ls ~$part" $test -nospace
+
+
+sync_after_int
+
+
+set test "~part should complete to ~full<space> if non-existing dir"
+# Create list of users, having non-existing home dir
+assert_bash_exec {for u in $(compgen -u); do \
+ eval test -d ~$u || echo $u; unset u; done} {} /@ users
+find_unique_completion_pair $users part full
+assert_complete "~$full " "ls ~$part" $test -nospace
sync_after_int
diff --git a/test/lib/completions/lsof.exp b/test/lib/completions/lsof.exp
new file mode 100644
index 00000000..551bde2a
--- /dev/null
+++ b/test/lib/completions/lsof.exp
@@ -0,0 +1,21 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "lsof "
+sync_after_int
+
+assert_complete_any "lsof -"
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvchange.exp b/test/lib/completions/lvchange.exp
index ec3886b8..6587a260 100644
--- a/test/lib/completions/lvchange.exp
+++ b/test/lib/completions/lvchange.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvcreate.exp b/test/lib/completions/lvcreate.exp
index 46dceb79..91cb0d81 100644
--- a/test/lib/completions/lvcreate.exp
+++ b/test/lib/completions/lvcreate.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvdisplay.exp b/test/lib/completions/lvdisplay.exp
index 5a01a0e5..6fa9c294 100644
--- a/test/lib/completions/lvdisplay.exp
+++ b/test/lib/completions/lvdisplay.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvextend.exp b/test/lib/completions/lvextend.exp
index 24a63853..ded34695 100644
--- a/test/lib/completions/lvextend.exp
+++ b/test/lib/completions/lvextend.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvm.exp b/test/lib/completions/lvm.exp
index 1c67825e..91fe0dcd 100644
--- a/test/lib/completions/lvm.exp
+++ b/test/lib/completions/lvm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvmdiskscan.exp b/test/lib/completions/lvmdiskscan.exp
index 27e566d4..6553865f 100644
--- a/test/lib/completions/lvmdiskscan.exp
+++ b/test/lib/completions/lvmdiskscan.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvreduce.exp b/test/lib/completions/lvreduce.exp
index edd5150d..e2708f89 100644
--- a/test/lib/completions/lvreduce.exp
+++ b/test/lib/completions/lvreduce.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvremove.exp b/test/lib/completions/lvremove.exp
index 1cd63150..8ca1517b 100644
--- a/test/lib/completions/lvremove.exp
+++ b/test/lib/completions/lvremove.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvrename.exp b/test/lib/completions/lvrename.exp
index 51624222..17179ce9 100644
--- a/test/lib/completions/lvrename.exp
+++ b/test/lib/completions/lvrename.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvresize.exp b/test/lib/completions/lvresize.exp
index 830b9ab1..2b3e1044 100644
--- a/test/lib/completions/lvresize.exp
+++ b/test/lib/completions/lvresize.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvs.exp b/test/lib/completions/lvs.exp
index 8b239f5d..e531f7e9 100644
--- a/test/lib/completions/lvs.exp
+++ b/test/lib/completions/lvs.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lvscan.exp b/test/lib/completions/lvscan.exp
index 841fd0ed..7b09e5e1 100644
--- a/test/lib/completions/lvscan.exp
+++ b/test/lib/completions/lvscan.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/lzma.exp b/test/lib/completions/lzma.exp
index 79d78854..ba57d10b 100644
--- a/test/lib/completions/lzma.exp
+++ b/test/lib/completions/lzma.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -17,7 +17,7 @@ assert_complete_any "lzma "
sync_after_int
-assert_complete "a/ bashcomp.lzma bashcomp.tlz" "lzma -d fixtures/xz/"
+assert_complete "a/ bashcomp.lzma bashcomp.tlz" "lzma -d $::srcdir/fixtures/xz/"
sync_after_int
diff --git a/test/lib/completions/lzop.exp b/test/lib/completions/lzop.exp
index c33e814e..a7d3da25 100644
--- a/test/lib/completions/lzop.exp
+++ b/test/lib/completions/lzop.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/m4.exp b/test/lib/completions/m4.exp
index 2cc884b3..334132db 100644
--- a/test/lib/completions/m4.exp
+++ b/test/lib/completions/m4.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {m4 --help} "" "" "unsupported"]} {
assert_complete_any "m4 --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/macof.exp b/test/lib/completions/macof.exp
index e21b1e77..873ae1da 100644
--- a/test/lib/completions/macof.exp
+++ b/test/lib/completions/macof.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mailmanctl.exp b/test/lib/completions/mailmanctl.exp
index a69b7650..2924806a 100644
--- a/test/lib/completions/mailmanctl.exp
+++ b/test/lib/completions/mailmanctl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mailsnarf.exp b/test/lib/completions/mailsnarf.exp
index df9981b7..9fb937f3 100644
--- a/test/lib/completions/mailsnarf.exp
+++ b/test/lib/completions/mailsnarf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/make.exp b/test/lib/completions/make.exp
index 90b9e68b..64a393da 100644
--- a/test/lib/completions/make.exp
+++ b/test/lib/completions/make.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/man.exp b/test/lib/completions/man.exp
index 62c14c86..c7358c62 100644
--- a/test/lib/completions/man.exp
+++ b/test/lib/completions/man.exp
@@ -1,17 +1,30 @@
proc setup {} {
+ assert_bash_exec "export MANPATH=$::srcdirabs/fixtures/man"
save_env
-}; # setup()
+}
proc teardown {} {
- assert_env_unmodified
-}; # teardown()
+ assert_env_unmodified {/OLDPWD/d}
+}
setup
-assert_complete_any "man man"
+assert_complete "bar" "man b"
+
+
+sync_after_int
+
+
+assert_complete_dir oo.1 "man man1/f" $::srcdir/fixtures/man
+
+
+sync_after_int
+
+
+assert_complete "Bash::Completion" "man Bash::C"
sync_after_int
diff --git a/test/lib/completions/mc.exp b/test/lib/completions/mc.exp
index 866161ba..eb97246d 100644
--- a/test/lib/completions/mc.exp
+++ b/test/lib/completions/mc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mcrypt.exp b/test/lib/completions/mcrypt.exp
index bfc5d2d2..525ccbc3 100644
--- a/test/lib/completions/mcrypt.exp
+++ b/test/lib/completions/mcrypt.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/md5sum.exp b/test/lib/completions/md5sum.exp
index 25290b56..54ed6416 100644
--- a/test/lib/completions/md5sum.exp
+++ b/test/lib/completions/md5sum.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mdecrypt.exp b/test/lib/completions/mdecrypt.exp
index 4e49ae12..8d9d9f59 100644
--- a/test/lib/completions/mdecrypt.exp
+++ b/test/lib/completions/mdecrypt.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mencoder.exp b/test/lib/completions/mencoder.exp
index 169dcb71..db29f66a 100644
--- a/test/lib/completions/mencoder.exp
+++ b/test/lib/completions/mencoder.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/minicom.exp b/test/lib/completions/minicom.exp
index 935502f1..dfc96c01 100644
--- a/test/lib/completions/minicom.exp
+++ b/test/lib/completions/minicom.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mkdir.exp b/test/lib/completions/mkdir.exp
index 43dfec7e..8d8c881d 100644
--- a/test/lib/completions/mkdir.exp
+++ b/test/lib/completions/mkdir.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -17,4 +17,10 @@ assert_complete_any "mkdir "
sync_after_int
+assert_complete {"bar bar.d/" foo.d/} "mkdir $::srcdir/fixtures/shared/default/"
+
+
+sync_after_int
+
+
teardown
diff --git a/test/lib/completions/mkfifo.exp b/test/lib/completions/mkfifo.exp
index c6343f8d..59412a2e 100644
--- a/test/lib/completions/mkfifo.exp
+++ b/test/lib/completions/mkfifo.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mkinitrd.exp b/test/lib/completions/mkinitrd.exp
index cfb316e5..007f278d 100644
--- a/test/lib/completions/mkinitrd.exp
+++ b/test/lib/completions/mkinitrd.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mkisofs.exp b/test/lib/completions/mkisofs.exp
index ad24ea06..98780b1e 100644
--- a/test/lib/completions/mkisofs.exp
+++ b/test/lib/completions/mkisofs.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -25,7 +25,7 @@ expect {
-re "^$cmd\r\n\\d+.*$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
@@ -39,7 +39,7 @@ expect {
-re "^$cmd\r\n\\d+.*$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/mknod.exp b/test/lib/completions/mknod.exp
index 2c58cade..145f4531 100644
--- a/test/lib/completions/mknod.exp
+++ b/test/lib/completions/mknod.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mktemp.exp b/test/lib/completions/mktemp.exp
new file mode 100644
index 00000000..8b0a3be2
--- /dev/null
+++ b/test/lib/completions/mktemp.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "mktemp -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mmsitepass.exp b/test/lib/completions/mmsitepass.exp
index d69fa202..4dde214f 100644
--- a/test/lib/completions/mmsitepass.exp
+++ b/test/lib/completions/mmsitepass.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/module.exp b/test/lib/completions/module.exp
index a34667d4..5e36a6da 100644
--- a/test/lib/completions/module.exp
+++ b/test/lib/completions/module.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mogrify.exp b/test/lib/completions/mogrify.exp
index ef7e18ee..84ceeff5 100644
--- a/test/lib/completions/mogrify.exp
+++ b/test/lib/completions/mogrify.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/montage.exp b/test/lib/completions/montage.exp
index 736609a5..4d85e1a4 100644
--- a/test/lib/completions/montage.exp
+++ b/test/lib/completions/montage.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mount.exp b/test/lib/completions/mount.exp
index 38d93e3b..c99d6058 100644
--- a/test/lib/completions/mount.exp
+++ b/test/lib/completions/mount.exp
@@ -5,11 +5,10 @@ proc setup_dummy_mnt {} {
assert_bash_exec {unset COMPREPLY cur}
assert_bash_exec {unset -f _mnt}
- global TESTDIR
assert_bash_exec { \
_mnt() { \
local cur=$(_get_cword); \
- _linux_fstab $(_get_pword) < "$TESTDIR/fixtures/mount/test-fstab"; \
+ _linux_fstab $(_get_pword) < "$SRCDIRABS/fixtures/mount/test-fstab"; \
}; \
complete -F _mnt mnt \
}
@@ -53,9 +52,9 @@ sync_after_int
set test "Check completing nfs mounts"
set expected [list /test/path /test/path2 /second/path]
set cmd "mount mocksrv:/"
-assert_bash_exec {OLDPATH="$PATH"; PATH="$TESTDIR/fixtures/mount/bin:$PATH";}
+assert_bash_exec {OLDPATH="$PATH"; PATH="$SRCDIRABS/fixtures/mount/bin:$PATH";}
# This needs an explicit cword param or will output "unresolved".
-assert_complete $expected $cmd $test "/@" 20 "/"
+assert_complete $expected $cmd $test -expect-cmd-minus /
sync_after_int
assert_bash_exec {PATH="$OLDPATH"; unset -v OLDPATH}
@@ -94,7 +93,7 @@ assert_complete {/mnt/nice\ test\\path} {mnt /mnt/nice\ test\\p}
sync_after_int
assert_complete {{/mnt/nice\ test\\path} {/mnt/nice\ test-path}} \
- {mnt /mnt/nice\ } "" /@ 20 {/mnt/nice\ }
+ {mnt /mnt/nice\ } "" -expect-cmd-minus {/mnt/nice\ }
sync_after_int
assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$}
diff --git a/test/lib/completions/mplayer.exp b/test/lib/completions/mplayer.exp
index 69e5d971..9230a86d 100644
--- a/test/lib/completions/mplayer.exp
+++ b/test/lib/completions/mplayer.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/msgsnarf.exp b/test/lib/completions/msgsnarf.exp
index 74f458ff..c542e33e 100644
--- a/test/lib/completions/msgsnarf.exp
+++ b/test/lib/completions/msgsnarf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mtx.exp b/test/lib/completions/mtx.exp
index a518d79f..1de15269 100644
--- a/test/lib/completions/mtx.exp
+++ b/test/lib/completions/mtx.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mutt.exp b/test/lib/completions/mutt.exp
index 6c727daf..8cb8b0c6 100644
--- a/test/lib/completions/mutt.exp
+++ b/test/lib/completions/mutt.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/OLDPWD=/d}
-}; # teardown()
+}
setup
@@ -19,12 +19,12 @@ sync_after_int
set test "mutt should complete mailboxes"
set expected {foo/ bar/ muttrc}
-assert_complete_dir $expected "mutt -F muttrc -f =" fixtures/mutt
+assert_complete_dir $expected "mutt -F muttrc -f =" $::srcdir/fixtures/mutt
set test "mutt should complete aliases"
set expected {a1 a2}
-assert_complete_dir $expected "mutt -F muttrc -A " fixtures/mutt
+assert_complete_dir $expected "mutt -F muttrc -A " $::srcdir/fixtures/mutt
sync_after_int
diff --git a/test/lib/completions/muttng.exp b/test/lib/completions/muttng.exp
index 25a474ad..32239128 100644
--- a/test/lib/completions/muttng.exp
+++ b/test/lib/completions/muttng.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mv.exp b/test/lib/completions/mv.exp
index f2576df7..d65c4868 100644
--- a/test/lib/completions/mv.exp
+++ b/test/lib/completions/mv.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/mysqladmin.exp b/test/lib/completions/mysqladmin.exp
index 76381587..ae9b8ce8 100644
--- a/test/lib/completions/mysqladmin.exp
+++ b/test/lib/completions/mysqladmin.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ncftp.exp b/test/lib/completions/ncftp.exp
index ad71f226..52d70756 100644
--- a/test/lib/completions/ncftp.exp
+++ b/test/lib/completions/ncftp.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/netstat.exp b/test/lib/completions/netstat.exp
index 0e6414d6..e4ef676c 100644
--- a/test/lib/completions/netstat.exp
+++ b/test/lib/completions/netstat.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/newlist.exp b/test/lib/completions/newlist.exp
index bebf600d..0696ec5e 100644
--- a/test/lib/completions/newlist.exp
+++ b/test/lib/completions/newlist.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/nl.exp b/test/lib/completions/nl.exp
index 02076dff..b7255ac2 100644
--- a/test/lib/completions/nl.exp
+++ b/test/lib/completions/nl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/nm.exp b/test/lib/completions/nm.exp
index 551f49e9..9ce73d45 100644
--- a/test/lib/completions/nm.exp
+++ b/test/lib/completions/nm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ntpdate.exp b/test/lib/completions/ntpdate.exp
index 6a6456f4..7a7dd716 100644
--- a/test/lib/completions/ntpdate.exp
+++ b/test/lib/completions/ntpdate.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/objcopy.exp b/test/lib/completions/objcopy.exp
index acb6539a..29be7e62 100644
--- a/test/lib/completions/objcopy.exp
+++ b/test/lib/completions/objcopy.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/objdump.exp b/test/lib/completions/objdump.exp
index 5eec35d6..c1f62e35 100644
--- a/test/lib/completions/objdump.exp
+++ b/test/lib/completions/objdump.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/od.exp b/test/lib/completions/od.exp
index 5838218c..e2712d12 100644
--- a/test/lib/completions/od.exp
+++ b/test/lib/completions/od.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/openssl.exp b/test/lib/completions/openssl.exp
index 651e5e6d..25fc1367 100644
--- a/test/lib/completions/openssl.exp
+++ b/test/lib/completions/openssl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -19,7 +19,7 @@ expect {
-re "^$cmd\r\n.*$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/p4.exp b/test/lib/completions/p4.exp
index 369d2c6b..20d8fb6e 100644
--- a/test/lib/completions/p4.exp
+++ b/test/lib/completions/p4.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pack200.exp b/test/lib/completions/pack200.exp
index f96eff13..537bf327 100644
--- a/test/lib/completions/pack200.exp
+++ b/test/lib/completions/pack200.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/paste.exp b/test/lib/completions/paste.exp
index 3a4e93be..224d9dd9 100644
--- a/test/lib/completions/paste.exp
+++ b/test/lib/completions/paste.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/patch.exp b/test/lib/completions/patch.exp
index a44fa130..07e88f15 100644
--- a/test/lib/completions/patch.exp
+++ b/test/lib/completions/patch.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/perl.exp b/test/lib/completions/perl.exp
index 2199c994..8cd6f957 100644
--- a/test/lib/completions/perl.exp
+++ b/test/lib/completions/perl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -18,7 +18,7 @@ sync_after_int
set test "Second argument should file complete"
-set cmd "perl foo fixtures/shared/default/f"
+set cmd "perl foo $::srcdir/fixtures/shared/default/f"
send "$cmd\t"
expect {
-re "^$cmd\r\nfoo +foo.d/ *\r\n/@${cmd}oo$" { pass "$test" }
@@ -31,7 +31,7 @@ sync_after_int
set test "-I without space should complete directories"
-set cmd "perl -Ifixtures/shared/default/"
+set cmd "perl -I$::srcdir/fixtures/shared/default/"
send "$cmd\t"
expect {
-re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" }
@@ -44,7 +44,7 @@ sync_after_int
set test "-I with space should complete directories"
-set cmd "perl -I fixtures/shared/default/"
+set cmd "perl -I $::srcdir/fixtures/shared/default/"
send "$cmd\t"
expect {
-re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" }
@@ -57,7 +57,7 @@ sync_after_int
set test "-x without space should complete directories"
-set cmd "perl -xfixtures/shared/default/b"
+set cmd "perl -x$::srcdir/fixtures/shared/default/b"
send "$cmd\t"
expect {
-re "^${cmd}ar\\\\ bar.d/ *$" { pass "$test" }
@@ -70,7 +70,7 @@ sync_after_int
set test "-x with space should complete directories"
-set cmd "perl -x fixtures/shared/default/b"
+set cmd "perl -x $::srcdir/fixtures/shared/default/b"
send "$cmd\t"
expect {
-re "^${cmd}ar\\\\ bar.d/ *$" { pass "$test" }
@@ -91,5 +91,30 @@ assert_complete $options "perl -"
sync_after_int
+assert_no_complete "perl -e "
+sync_after_int
+
+assert_complete_any "perl -V:install"
+sync_after_int
+
+assert_complete_any "perl -V::install"
+sync_after_int
+
+# Assuming that File::Spec and friends are always installed...
+
+assert_complete_any "perl -MFile"
+sync_after_int
+
+assert_complete_any "perl -MFile::Sp"
+sync_after_int
+
+assert_complete_any "perl -MFile::Spec::Func"
+sync_after_int
+
+assert_complete_any "perl -M-File"
+sync_after_int
+
+assert_complete_any "perl -m-File::"
+sync_after_int
teardown
diff --git a/test/lib/completions/perldoc.exp b/test/lib/completions/perldoc.exp
index b3ff83b3..dc1c79c8 100644
--- a/test/lib/completions/perldoc.exp
+++ b/test/lib/completions/perldoc.exp
@@ -1,22 +1,16 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
-assert_complete_any "perldoc -"
-
-
-sync_after_int
-
-
set test "perldoc should complete word containing colons"
set cmd "perldoc File::"
send "$cmd\t"
@@ -29,7 +23,16 @@ expect {
-re "perldoc File::File::" { fail "$test" }
-re /@ { unresolved "$test" }
default { unresolved "$test" }
-}; # expect
+}
+
+
+sync_after_int
+
+set test "- should complete options"
+set options {
+ -h -v -t -u -m -l -F -X -f -q
+}
+assert_complete $options "perldoc -"
sync_after_int
diff --git a/test/lib/completions/pgrep.exp b/test/lib/completions/pgrep.exp
index 63143acc..c27c4f21 100644
--- a/test/lib/completions/pgrep.exp
+++ b/test/lib/completions/pgrep.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pine.exp b/test/lib/completions/pine.exp
index 0a0c3f40..622bf064 100644
--- a/test/lib/completions/pine.exp
+++ b/test/lib/completions/pine.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ping.exp b/test/lib/completions/ping.exp
index b600849b..3e419966 100644
--- a/test/lib/completions/ping.exp
+++ b/test/lib/completions/ping.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pkg-config.exp b/test/lib/completions/pkg-config.exp
index 477dba08..adf9a301 100644
--- a/test/lib/completions/pkg-config.exp
+++ b/test/lib/completions/pkg-config.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pkg_deinstall.exp b/test/lib/completions/pkg_deinstall.exp
index 8f3d8c3d..c2b3ae0b 100644
--- a/test/lib/completions/pkg_deinstall.exp
+++ b/test/lib/completions/pkg_deinstall.exp
@@ -1,18 +1,18 @@
proc setup {} {
- assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db}
+ assert_bash_exec {PKG_DBDIR=$::srcdir/fixtures/pkgtools/db}
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
-set pkgs [exec bash -c "cd fixtures/pkgtools/db ; compgen -d"]
+set pkgs [exec bash -c "cd $::srcdir/fixtures/pkgtools/db ; compgen -d"]
assert_complete $pkgs "pkg_deinstall "
diff --git a/test/lib/completions/pkg_delete.exp b/test/lib/completions/pkg_delete.exp
index b0c1a2a5..37ce4035 100644
--- a/test/lib/completions/pkg_delete.exp
+++ b/test/lib/completions/pkg_delete.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pkg_info.exp b/test/lib/completions/pkg_info.exp
index 3f253ccf..ad8ed84e 100644
--- a/test/lib/completions/pkg_info.exp
+++ b/test/lib/completions/pkg_info.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pkill.exp b/test/lib/completions/pkill.exp
index 0333fc94..6faddfc3 100644
--- a/test/lib/completions/pkill.exp
+++ b/test/lib/completions/pkill.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/portinstall.exp b/test/lib/completions/portinstall.exp
index d70f5db6..ab14afa8 100644
--- a/test/lib/completions/portinstall.exp
+++ b/test/lib/completions/portinstall.exp
@@ -1,13 +1,13 @@
proc setup {} {
- assert_bash_exec {PORTSDIR=fixtures/pkgtools/ports ; sed -e s,PORTSDIR,$PORTSDIR,g $PORTSDIR/INDEX.dist > $PORTSDIR/INDEX ; cp $PORTSDIR/INDEX $PORTSDIR/INDEX-5}
+ assert_bash_exec {PORTSDIR=$TESTDIR/tmp; sed -e s,PORTSDIR,$PORTSDIR,g $::srcdir/fixtures/pkgtools/ports/INDEX.dist > $PORTSDIR/INDEX; cp $PORTSDIR/INDEX $PORTSDIR/INDEX-5}
save_env
-}; # setup()
+}
proc teardown {} {
- assert_bash_exec {rm fixtures/pkgtools/ports/INDEX fixtures/pkgtools/ports/INDEX-5}
+ assert_bash_exec {rm $PORTSDIR/INDEX $PORTSDIR/INDEX-5}
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/portupgrade.exp b/test/lib/completions/portupgrade.exp
index cb583923..62b5789d 100644
--- a/test/lib/completions/portupgrade.exp
+++ b/test/lib/completions/portupgrade.exp
@@ -1,12 +1,12 @@
proc setup {} {
assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db}
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/povray.exp b/test/lib/completions/povray.exp
index 1efeeddb..30d58e48 100644
--- a/test/lib/completions/povray.exp
+++ b/test/lib/completions/povray.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pr.exp b/test/lib/completions/pr.exp
index 5d7a96c3..478017b2 100644
--- a/test/lib/completions/pr.exp
+++ b/test/lib/completions/pr.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/psql.exp b/test/lib/completions/psql.exp
index 56d56666..3dbffaf2 100644
--- a/test/lib/completions/psql.exp
+++ b/test/lib/completions/psql.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ptx.exp b/test/lib/completions/ptx.exp
index 2defe049..220243c3 100644
--- a/test/lib/completions/ptx.exp
+++ b/test/lib/completions/ptx.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pvchange.exp b/test/lib/completions/pvchange.exp
index fd4b73d0..a43ae9cd 100644
--- a/test/lib/completions/pvchange.exp
+++ b/test/lib/completions/pvchange.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pvcreate.exp b/test/lib/completions/pvcreate.exp
index 47cebf7a..6bc9d4eb 100644
--- a/test/lib/completions/pvcreate.exp
+++ b/test/lib/completions/pvcreate.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pvdisplay.exp b/test/lib/completions/pvdisplay.exp
index 151064cd..b9db558b 100644
--- a/test/lib/completions/pvdisplay.exp
+++ b/test/lib/completions/pvdisplay.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pvmove.exp b/test/lib/completions/pvmove.exp
index 81c05e98..24d17006 100644
--- a/test/lib/completions/pvmove.exp
+++ b/test/lib/completions/pvmove.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pvremove.exp b/test/lib/completions/pvremove.exp
index dd145bf6..1febcf37 100644
--- a/test/lib/completions/pvremove.exp
+++ b/test/lib/completions/pvremove.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pvs.exp b/test/lib/completions/pvs.exp
index 6e5527e1..e50501a3 100644
--- a/test/lib/completions/pvs.exp
+++ b/test/lib/completions/pvs.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/pvscan.exp b/test/lib/completions/pvscan.exp
index e92cdbe0..d3b8ad33 100644
--- a/test/lib/completions/pvscan.exp
+++ b/test/lib/completions/pvscan.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/python.exp b/test/lib/completions/python.exp
index c9d70b43..446e3d09 100644
--- a/test/lib/completions/python.exp
+++ b/test/lib/completions/python.exp
@@ -1,19 +1,20 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
assert_complete_any "python "
+sync_after_int
-
+assert_complete_any "python -"
sync_after_int
diff --git a/test/lib/completions/qrunner.exp b/test/lib/completions/qrunner.exp
index b8fcf191..0dec16cc 100644
--- a/test/lib/completions/qrunner.exp
+++ b/test/lib/completions/qrunner.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/querybts.exp b/test/lib/completions/querybts.exp
index dc75cd62..4ed09d8a 100644
--- a/test/lib/completions/querybts.exp
+++ b/test/lib/completions/querybts.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rcs.exp b/test/lib/completions/rcs.exp
index 19ae4d50..781ac37f 100644
--- a/test/lib/completions/rcs.exp
+++ b/test/lib/completions/rcs.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rcsdiff.exp b/test/lib/completions/rcsdiff.exp
index 8383cdb9..23b009c6 100644
--- a/test/lib/completions/rcsdiff.exp
+++ b/test/lib/completions/rcsdiff.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rdict.exp b/test/lib/completions/rdict.exp
index aa132617..5d6ad847 100644
--- a/test/lib/completions/rdict.exp
+++ b/test/lib/completions/rdict.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/readelf.exp b/test/lib/completions/readelf.exp
index a084a41e..c2d5ee5b 100644
--- a/test/lib/completions/readelf.exp
+++ b/test/lib/completions/readelf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/readonly.exp b/test/lib/completions/readonly.exp
index 84be3c96..cf64ca0a 100644
--- a/test/lib/completions/readonly.exp
+++ b/test/lib/completions/readonly.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/remove_members.exp b/test/lib/completions/remove_members.exp
index 63d6a70e..59f7b6c4 100644
--- a/test/lib/completions/remove_members.exp
+++ b/test/lib/completions/remove_members.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/removepkg.exp b/test/lib/completions/removepkg.exp
index 7cf98805..882f1e70 100644
--- a/test/lib/completions/removepkg.exp
+++ b/test/lib/completions/removepkg.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/renice.exp b/test/lib/completions/renice.exp
index c91e0212..fdc859b4 100644
--- a/test/lib/completions/renice.exp
+++ b/test/lib/completions/renice.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -19,7 +19,7 @@ expect {
-re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
@@ -33,7 +33,7 @@ expect {
-re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-re eof { unresolved "eof" }
-}; # expect
+}
sync_after_int
diff --git a/test/lib/completions/reportbug.exp b/test/lib/completions/reportbug.exp
index 1f66df2c..660778f7 100644
--- a/test/lib/completions/reportbug.exp
+++ b/test/lib/completions/reportbug.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ri.exp b/test/lib/completions/ri.exp
index 160dc9a7..cd138ea0 100644
--- a/test/lib/completions/ri.exp
+++ b/test/lib/completions/ri.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rlog.exp b/test/lib/completions/rlog.exp
index cbc06857..87984a8d 100644
--- a/test/lib/completions/rlog.exp
+++ b/test/lib/completions/rlog.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rm.exp b/test/lib/completions/rm.exp
index ae670e83..f764a8e7 100644
--- a/test/lib/completions/rm.exp
+++ b/test/lib/completions/rm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rmdir.exp b/test/lib/completions/rmdir.exp
index 2b23a9c5..1a904b64 100644
--- a/test/lib/completions/rmdir.exp
+++ b/test/lib/completions/rmdir.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -17,4 +17,10 @@ assert_complete_any "rmdir "
sync_after_int
+assert_complete {"bar bar.d/" foo.d/} "rmdir $::srcdir/fixtures/shared/default/"
+
+
+sync_after_int
+
+
teardown
diff --git a/test/lib/completions/rmlist.exp b/test/lib/completions/rmlist.exp
index 91519ee8..d530d117 100644
--- a/test/lib/completions/rmlist.exp
+++ b/test/lib/completions/rmlist.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rpcdebug.exp b/test/lib/completions/rpcdebug.exp
index 8629c947..7f1a1c2f 100644
--- a/test/lib/completions/rpcdebug.exp
+++ b/test/lib/completions/rpcdebug.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rpm.exp b/test/lib/completions/rpm.exp
index 3ed154a9..82ab28dc 100644
--- a/test/lib/completions/rpm.exp
+++ b/test/lib/completions/rpm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -20,7 +20,7 @@ sync_after_int
# Build list of installed packages
if {[assert_exec {rpm -qa --qf=%\{NAME\}\n | sort -u} packages]} {
assert_complete $packages "rpm -q "
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/rsync.exp b/test/lib/completions/rsync.exp
index fb301a35..221d090b 100644
--- a/test/lib/completions/rsync.exp
+++ b/test/lib/completions/rsync.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/rtcwake.exp b/test/lib/completions/rtcwake.exp
index 0b9a974b..21c05eab 100644
--- a/test/lib/completions/rtcwake.exp
+++ b/test/lib/completions/rtcwake.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sbcl-mt.exp b/test/lib/completions/sbcl-mt.exp
index 45e81f79..a80e543b 100644
--- a/test/lib/completions/sbcl-mt.exp
+++ b/test/lib/completions/sbcl-mt.exp
@@ -1,17 +1,17 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
-assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl-mt fixtures/shared/default/"
+assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl-mt $::srcdir/fixtures/shared/default/"
sync_after_int
diff --git a/test/lib/completions/sbcl.exp b/test/lib/completions/sbcl.exp
index b68b2dce..3adeb6bf 100644
--- a/test/lib/completions/sbcl.exp
+++ b/test/lib/completions/sbcl.exp
@@ -1,17 +1,17 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
-assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl fixtures/shared/default/"
+assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl $::srcdir/fixtures/shared/default/"
sync_after_int
diff --git a/test/lib/completions/scp.exp b/test/lib/completions/scp.exp
index efe2b686..e6cbf8e3 100644
--- a/test/lib/completions/scp.exp
+++ b/test/lib/completions/scp.exp
@@ -1,15 +1,19 @@
proc setup {} {
save_env
-}; # setup()
+ # NOTE: Changing dir to $SRCDIR is necessary because file locations in the
+ # ssh config files (e.g. UserKnownHostsFile) are relative to $SRCDIR.
+ assert_bash_exec {cd $SRCDIR/fixtures/scp}
+}
proc teardown {} {
+ assert_bash_exec {cd $TESTDIR}
assert_env_unmodified {
/BASH_LINENO=/d
/BASH_SOURCE=/d
/OLDPWD=/d
}
-}; # teardown()
+}
setup
@@ -31,7 +35,7 @@ if {
# in `$HOME/.ssh/config' or `/etc/ssh_config'
set host_pwd ""
unsupported $test
-}; # if
+}
# Try completion
@@ -41,7 +45,7 @@ sync_after_tab
expect {
-re "^$cmd$host_pwd.*$" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
-}; # expect
+}
sync_after_int
@@ -52,16 +56,15 @@ set test "Tab should complete known-hosts"
# Build string list of expected completions
# Get hostnames and give them a colon (:) suffix
# Hosts `gee' and `hus' are defined in ./fixtures/scp/config
- # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts
+ # Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts
set expected {}
foreach host [get_hosts] {
lappend expected "$host:"
-}; # foreach
-lappend expected doo: gee: hus: ike:
+}
+lappend expected blah: doo: gee: hus: ike:
# Append local filenames
lappend expected config known_hosts "spaced\\ \\ conf"
-set dir fixtures/scp
-assert_complete_dir $expected "scp -F config " $dir
+assert_complete $expected "scp -F config "
sync_after_int
@@ -76,7 +79,7 @@ expect {
-re "^$cmd\r\n.*\r\n/@" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
default { unresolved "$test" }
-}; # expect
+}
sync_after_int
@@ -88,30 +91,26 @@ set test "Config file containing space should work"
set expected {}
foreach host [get_hosts] {
lappend expected "$host:"
-}; # foreach
+}
# Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf"
- # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts
-lappend expected doo: gee: hus: ike: jar:
+ # Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts
+lappend expected blah: doo: gee: hus: ike: jar:
# Append local filenames
lappend expected config known_hosts "spaced\\ \\ conf"
-set dir fixtures/scp
-#assert_complete_dir $expected "scp -F 'spaced conf' " $dir
-set prompt "/$dir/@"
-assert_bash_exec "cd $dir" "" $prompt
set cmd "scp -F 'spaced conf' "
send "$cmd\t"
expect -ex "$cmd\r\n"
-if {[match_items [lsort -unique $expected] $test]} {
+if {[match_items [lsort -unique $expected] -bash-sort]} {
expect {
- -re $prompt { pass "$test" }
+ -re /@ { pass "$test" }
-re eof { unresolved "eof" }
- }; # expect
+ }
} else {
# Expected failure (known bug) because of bash-4 bug in quoted words:
# http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html
if {[lindex $::BASH_VERSINFO 0] >= 4} {xfail "$test"} {fail "$test"}
-}; # if
-sync_after_int $prompt
+}
+sync_after_int
assert_bash_exec {cd "$TESTDIR"}
diff --git a/test/lib/completions/screen.exp b/test/lib/completions/screen.exp
index 985862c1..e5bc4c15 100644
--- a/test/lib/completions/screen.exp
+++ b/test/lib/completions/screen.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/OLDPWD=/d}
-}; # teardown()
+}
setup
@@ -17,33 +17,8 @@ assert_complete_any "screen -"
sync_after_int
-set test "-c should complete files/dirs"
-set dir fixtures/shared/default
-set prompt "/$dir/@"
-assert_bash_exec "cd $dir" "" $prompt
-set cmd "screen -c "
-set expected {bar {bar bar.d} foo {foo.d}}
-send "$cmd\t"
-expect -ex "$cmd"
-expect {
- -re "\r\nbar\\s+bar bar.d/\\s+foo\\s+foo.d/" { pass "$test" }
- # Directories might not be suffixed with a slash (/). This is because
- # _filedir only works if `-o filenames' is in effect, which isn't the
- # case for `screen' on bash-3, so an expected failure (xfail)
- -re "\r\nbar\\s+bar bar.d\\s+foo\\s+foo.d" {
- if {[lindex $::BASH_VERSINFO 0] < 4} {xfail "$test"} {fail "$test"}
- }
- -re "\r\nbar\\s+bar\\\\ bar.d/\\s+foo\\s+foo.d/" {
- # On bash-3, the space in `bar bar.d' is escaped with a backslash
- # as a side-effect of emulating `-o filenames'.
- if {[lindex $::BASH_VERSINFO 0] <= 3} {pass "$test"} {fail "$test"}
- }
- -re $prompt { unresolved "$test at prompt" }
- default { unresolved "$test" }
-}; # expect
-sync_after_int $prompt
-assert_bash_exec {cd "$TESTDIR"}
-
+assert_complete {bar "bar bar.d/" foo foo.d/} \
+ "screen -c $::srcdir/fixtures/shared/default/" "-c should complete files/dirs"
sync_after_int
diff --git a/test/lib/completions/sed.exp b/test/lib/completions/sed.exp
index 8764cfb8..dd480a60 100644
--- a/test/lib/completions/sed.exp
+++ b/test/lib/completions/sed.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {sed --help} "" "" "unsupported"]} {
assert_complete_any "sed --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/seq.exp b/test/lib/completions/seq.exp
index b5333ef9..6e5ef8dc 100644
--- a/test/lib/completions/seq.exp
+++ b/test/lib/completions/seq.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/service.exp b/test/lib/completions/service.exp
index 917c5dcb..f3cf7355 100644
--- a/test/lib/completions/service.exp
+++ b/test/lib/completions/service.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/set.exp b/test/lib/completions/set.exp
index 2b2d40e9..c14ecff6 100644
--- a/test/lib/completions/set.exp
+++ b/test/lib/completions/set.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sftp.exp b/test/lib/completions/sftp.exp
index 24c37cb5..27fe7511 100644
--- a/test/lib/completions/sftp.exp
+++ b/test/lib/completions/sftp.exp
@@ -1,15 +1,19 @@
proc setup {} {
save_env
-}; # setup()
+ # NOTE: Changing dir to $SRCDIR is necessary because file locations in the
+ # ssh config files (e.g. UserKnownHostsFile) are relative to $SRCDIR.
+ assert_bash_exec {cd $SRCDIR/fixtures/sftp}
+}
proc teardown {} {
+ assert_bash_exec {cd $TESTDIR}
assert_env_unmodified {
/BASH_LINENO=/d
/BASH_SOURCE=/d
/OLDPWD=/d
}
-}; # teardown()
+}
setup
@@ -18,10 +22,9 @@ setup
# Build string list of expected completions
set expected [get_hosts]
# Hosts `gee' and `hus' are defined in ./fixtures/sftp/config
- # Hosts `doo' and `ike' are defined in ./fixtures/sftp/known_hosts
-lappend expected doo gee hus ike
-set dir fixtures/scp
-assert_complete_dir $expected "sftp -F config " $dir
+ # Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts
+lappend expected 10.10.10.10 doo gee hus ike
+assert_complete $expected "sftp -F config "
sync_after_int
@@ -36,7 +39,7 @@ expect {
-re "^$cmd\r\n.*\r\n/@" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
default { unresolved "$test" }
-}; # expect
+}
sync_after_int
@@ -45,33 +48,17 @@ sync_after_int
# Build string list of expected completions
# Get hostnames and give them a colon (:) suffix
set expected [get_hosts]
- # Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf"
- # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts
-lappend expected doo gee hus ike jar
-set dir fixtures/sftp
-assert_complete_dir $expected "sftp -F spaced\\ \\ conf " $dir
+ # Hosts `gee', `hus' and `jar' are defined in "./fixtures/sftp/spaced conf"
+ # Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts
+lappend expected 10.10.10.10 doo gee hus ike jar
+assert_complete $expected "sftp -F spaced\\ \\ conf "
sync_after_int
-set test "-F should complete filename"
-set dir fixtures/sftp
-set prompt "/$dir/@"
-assert_bash_exec "cd $dir" "" $prompt
-set cmd "ssh -Fsp"
-send "$cmd\t"
-expect -ex "$cmd"
-expect {
- -ex "aced\\ \\ conf" { pass "$test" }
- # _filedir works only if `-o filenames' is in effect, which isn't the
- # case for `sftp'
- -re "aced conf" { xfail "$test" }
- -re $prompt { unresolved "$test at prompt" }
- default { unresolved "$test" }
-}; # expect
-sync_after_int $prompt
-assert_bash_exec {cd "$TESTDIR"}
+assert_complete "-Fspaced\\ \\ conf" "sftp -Fsp" "-F should complete filename"
+sync_after_int
teardown
diff --git a/test/lib/completions/sh.exp b/test/lib/completions/sh.exp
new file mode 100644
index 00000000..e1a51bb9
--- /dev/null
+++ b/test/lib/completions/sh.exp
@@ -0,0 +1,38 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "sh -"
+
+
+sync_after_int
+
+
+assert_complete_any "sh +"
+
+
+sync_after_int
+
+
+assert_complete_any "sh -o "
+
+
+sync_after_int
+
+
+assert_no_complete "sh -c "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sha1sum.exp b/test/lib/completions/sha1sum.exp
index 17519087..c5983044 100644
--- a/test/lib/completions/sha1sum.exp
+++ b/test/lib/completions/sha1sum.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/shar.exp b/test/lib/completions/shar.exp
index 7ace9d6e..604a2031 100644
--- a/test/lib/completions/shar.exp
+++ b/test/lib/completions/shar.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sitecopy.exp b/test/lib/completions/sitecopy.exp
index 49b78918..7e0c87fe 100644
--- a/test/lib/completions/sitecopy.exp
+++ b/test/lib/completions/sitecopy.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/smartctl.exp b/test/lib/completions/smartctl.exp
index a9eeb956..24919396 100644
--- a/test/lib/completions/smartctl.exp
+++ b/test/lib/completions/smartctl.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/snownews.exp b/test/lib/completions/snownews.exp
index 7502e587..c8ad6741 100644
--- a/test/lib/completions/snownews.exp
+++ b/test/lib/completions/snownews.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sort.exp b/test/lib/completions/sort.exp
index 20516cc8..a130bbc8 100644
--- a/test/lib/completions/sort.exp
+++ b/test/lib/completions/sort.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/split.exp b/test/lib/completions/split.exp
index b74da369..e13df49a 100644
--- a/test/lib/completions/split.exp
+++ b/test/lib/completions/split.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {split --help} "" "" "unsupported"]} {
assert_complete_any "split --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/spovray.exp b/test/lib/completions/spovray.exp
index 30d81853..2b2c33de 100644
--- a/test/lib/completions/spovray.exp
+++ b/test/lib/completions/spovray.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sqlite3.exp b/test/lib/completions/sqlite3.exp
new file mode 100644
index 00000000..af1ada82
--- /dev/null
+++ b/test/lib/completions/sqlite3.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "sqlite3 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ssh.exp b/test/lib/completions/ssh.exp
index 91955c1d..1599dccc 100644
--- a/test/lib/completions/ssh.exp
+++ b/test/lib/completions/ssh.exp
@@ -1,15 +1,19 @@
proc setup {} {
save_env
-}; # setup()
+ # NOTE: Changing dir to $SRCDIR is necessary because file locations in the
+ # ssh config files (e.g. UserKnownHostsFile) are relative to $SRCDIR.
+ assert_bash_exec {cd $SRCDIR/fixtures/ssh}
+}
proc teardown {} {
+ assert_bash_exec {cd $TESTDIR}
assert_env_unmodified {
/BASH_LINENO=/d
/BASH_SOURCE=/d
/OLDPWD=/d
}
-}; # teardown()
+}
setup
@@ -17,19 +21,14 @@ setup
set test "Tab should complete both commands and hostname"
# Try completion
-set dir fixtures/ssh
-set prompt "/$dir/@"
-assert_bash_exec "cd $dir" "" $prompt
set cmd "ssh -F config ls"
send "$cmd\t"
-set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n$prompt$cmd$"
+set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n/@$cmd$"
expect {
-re $expected { pass "$test" }
- -re $prompt { unresolved "$test at prompt" }
+ -re /@ { unresolved "$test at prompt" }
default { unresolved "$test" }
-}; # expect
-sync_after_int $prompt
-assert_bash_exec {cd "$TESTDIR"}
+}
sync_after_int
@@ -45,7 +44,7 @@ expect {
-re "^$cmd\r\n.*\r\n/@" { pass "$test" }
-re /@ { unresolved "$test at prompt" }
default { unresolved "$test" }
-}; # expect
+}
sync_after_int
@@ -61,30 +60,14 @@ sync_after_int
set test "First argument should complete partial hostname"
-assert_complete_partial [get_hosts] ssh "" $test /@ 20 \
- [list "ltrim_colon_completions"]
+assert_complete_partial [get_hosts] ssh "" $test -ltrim-colon-completions
sync_after_int
set test "-F should complete filename"
-set dir fixtures/ssh
-set prompt "/$dir/@"
-assert_bash_exec "cd $dir" "" $prompt
-set cmd "ssh -Fsp"
-send "$cmd\t"
-expect -ex "$cmd"
-expect {
- -ex "aced\\ \\ conf" { pass "$test" }
- # _filedir works only if `-o filenames' is in effect, which isn't the
- # case for `ssh'
- -re "aced conf" { xfail "$test" }
- -re $prompt { unresolved "$test at prompt" }
- default { unresolved "$test" }
-}; # expect
-sync_after_int $prompt
-assert_bash_exec {cd "$TESTDIR"}
+assert_complete "-Fspaced\\ \\ conf" "ssh -Fsp" $test
sync_after_int
diff --git a/test/lib/completions/sshmitm.exp b/test/lib/completions/sshmitm.exp
index b8f8a2c9..13b50673 100644
--- a/test/lib/completions/sshmitm.exp
+++ b/test/lib/completions/sshmitm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sshow.exp b/test/lib/completions/sshow.exp
index 36a6cc2c..074d7b12 100644
--- a/test/lib/completions/sshow.exp
+++ b/test/lib/completions/sshow.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/strace.exp b/test/lib/completions/strace.exp
index 55004d20..933d1b48 100644
--- a/test/lib/completions/strace.exp
+++ b/test/lib/completions/strace.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/strip.exp b/test/lib/completions/strip.exp
index 46d9f362..00f4ab9c 100644
--- a/test/lib/completions/strip.exp
+++ b/test/lib/completions/strip.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sudo.exp b/test/lib/completions/sudo.exp
index 1299a6da..d6bbbbb6 100644
--- a/test/lib/completions/sudo.exp
+++ b/test/lib/completions/sudo.exp
@@ -1,17 +1,24 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
- assert_env_unmodified
-}; # teardown()
+ assert_env_unmodified {/OLDPWD/d}
+}
setup
-assert_complete "fixtures/shared/default/foo.d/" "sudo cd fixtures/shared/default/fo"
+assert_complete_dir foo.d/ "sudo cd fo" $::srcdir/fixtures/shared/default \
+ "" -nospace
+
+
+sync_after_int
+
+
+assert_complete_dir fixtures/ "sudo sh fix" $::srcdir "" -nospace
sync_after_int
diff --git a/test/lib/completions/svk.exp b/test/lib/completions/svk.exp
index a08674dc..a794a008 100644
--- a/test/lib/completions/svk.exp
+++ b/test/lib/completions/svk.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/svn.exp b/test/lib/completions/svn.exp
index fe40d6f7..d1a08ae4 100644
--- a/test/lib/completions/svn.exp
+++ b/test/lib/completions/svn.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/svnadmin.exp b/test/lib/completions/svnadmin.exp
index 35e07021..f20d52cf 100644
--- a/test/lib/completions/svnadmin.exp
+++ b/test/lib/completions/svnadmin.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/svnlook.exp b/test/lib/completions/svnlook.exp
index 33b67052..114435ec 100644
--- a/test/lib/completions/svnlook.exp
+++ b/test/lib/completions/svnlook.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sync_members.exp b/test/lib/completions/sync_members.exp
index 4cb84ad8..817432bb 100644
--- a/test/lib/completions/sync_members.exp
+++ b/test/lib/completions/sync_members.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/sysbench.exp b/test/lib/completions/sysbench.exp
new file mode 100644
index 00000000..2a0fe339
--- /dev/null
+++ b/test/lib/completions/sysbench.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "sysbench "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sysctl.exp b/test/lib/completions/sysctl.exp
index e1866f55..6aa9ffe0 100644
--- a/test/lib/completions/sysctl.exp
+++ b/test/lib/completions/sysctl.exp
@@ -1,19 +1,20 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
if {[assert_exec {sysctl -N -a 2>/dev/null | grep ^kern | sort -u} values]} {
- assert_complete $values "sysctl kern"
-}; # if
+ set test "sysctl kern should show completions"
+ assert_complete $values "sysctl kern" $test -expect-cmd-minus kern
+}
sync_after_int
diff --git a/test/lib/completions/tac.exp b/test/lib/completions/tac.exp
index 21230052..d4fe7937 100644
--- a/test/lib/completions/tac.exp
+++ b/test/lib/completions/tac.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/tail.exp b/test/lib/completions/tail.exp
index c8a82d97..fd685b1a 100644
--- a/test/lib/completions/tail.exp
+++ b/test/lib/completions/tail.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {tail --help} "" "" "unsupported"]} {
assert_complete_any "tail --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/tar.exp b/test/lib/completions/tar.exp
index 43c60ff9..37f1ae4b 100644
--- a/test/lib/completions/tar.exp
+++ b/test/lib/completions/tar.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/tcpkill.exp b/test/lib/completions/tcpkill.exp
index e8cc9c10..d3a45e43 100644
--- a/test/lib/completions/tcpkill.exp
+++ b/test/lib/completions/tcpkill.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/tcpnice.exp b/test/lib/completions/tcpnice.exp
index 44bb59c6..b4b93097 100644
--- a/test/lib/completions/tcpnice.exp
+++ b/test/lib/completions/tcpnice.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/tee.exp b/test/lib/completions/tee.exp
index c25057ba..1058bb8e 100644
--- a/test/lib/completions/tee.exp
+++ b/test/lib/completions/tee.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/texindex.exp b/test/lib/completions/texindex.exp
index d5b8cd77..43b4c09a 100644
--- a/test/lib/completions/texindex.exp
+++ b/test/lib/completions/texindex.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/tightvncviewer.exp b/test/lib/completions/tightvncviewer.exp
index 6eba24c2..ee987f60 100644
--- a/test/lib/completions/tightvncviewer.exp
+++ b/test/lib/completions/tightvncviewer.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/time.exp b/test/lib/completions/time.exp
index b114318b..3bed4fdf 100644
--- a/test/lib/completions/time.exp
+++ b/test/lib/completions/time.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/touch.exp b/test/lib/completions/touch.exp
index f0960ef7..61d22b33 100644
--- a/test/lib/completions/touch.exp
+++ b/test/lib/completions/touch.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {touch --help} "" "" "unsupported"]} {
assert_complete_any "touch --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/tr.exp b/test/lib/completions/tr.exp
index 68b11a36..c10c8ba1 100644
--- a/test/lib/completions/tr.exp
+++ b/test/lib/completions/tr.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {tr --help} "" "" "unsupported"]} {
assert_complete_any "tr --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/tune2fs.exp b/test/lib/completions/tune2fs.exp
new file mode 100644
index 00000000..df70d904
--- /dev/null
+++ b/test/lib/completions/tune2fs.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "tune2fs "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/unace.exp b/test/lib/completions/unace.exp
index 0afbaafb..c9d7606e 100644
--- a/test/lib/completions/unace.exp
+++ b/test/lib/completions/unace.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/uname.exp b/test/lib/completions/uname.exp
index 2179dafd..0c363ab5 100644
--- a/test/lib/completions/uname.exp
+++ b/test/lib/completions/uname.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {uname --help} "" "" "unsupported"]} {
assert_complete_any "uname --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/unexpand.exp b/test/lib/completions/unexpand.exp
index 31822561..c9aecc25 100644
--- a/test/lib/completions/unexpand.exp
+++ b/test/lib/completions/unexpand.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {unexpand --help} "" "" "unsupported"]} {
assert_complete_any "unexpand --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/uniq.exp b/test/lib/completions/uniq.exp
index 20dbcfac..d516106c 100644
--- a/test/lib/completions/uniq.exp
+++ b/test/lib/completions/uniq.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {uniq --help} "" "" "unsupported"]} {
assert_complete_any "uniq --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/units.exp b/test/lib/completions/units.exp
index a40b5f3f..96ec91d1 100644
--- a/test/lib/completions/units.exp
+++ b/test/lib/completions/units.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {units --help} "" "" "unsupported"]} {
assert_complete_any "units --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/unpack200.exp b/test/lib/completions/unpack200.exp
index 845701dd..b4360491 100644
--- a/test/lib/completions/unpack200.exp
+++ b/test/lib/completions/unpack200.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/unrar.exp b/test/lib/completions/unrar.exp
index e66e3c8b..b5e27b21 100644
--- a/test/lib/completions/unrar.exp
+++ b/test/lib/completions/unrar.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/unset.exp b/test/lib/completions/unset.exp
index a5e7fc9b..42e753cb 100644
--- a/test/lib/completions/unset.exp
+++ b/test/lib/completions/unset.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/unshunt.exp b/test/lib/completions/unshunt.exp
index 964cac68..96cd5860 100644
--- a/test/lib/completions/unshunt.exp
+++ b/test/lib/completions/unshunt.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/update-alternatives.exp b/test/lib/completions/update-alternatives.exp
index 10ff4e6d..b94d88c5 100644
--- a/test/lib/completions/update-alternatives.exp
+++ b/test/lib/completions/update-alternatives.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/update-rc.d.exp b/test/lib/completions/update-rc.d.exp
index 9c2c2464..f2eafea5 100644
--- a/test/lib/completions/update-rc.d.exp
+++ b/test/lib/completions/update-rc.d.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/urlsnarf.exp b/test/lib/completions/urlsnarf.exp
index c5b26922..ed543629 100644
--- a/test/lib/completions/urlsnarf.exp
+++ b/test/lib/completions/urlsnarf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vdir.exp b/test/lib/completions/vdir.exp
index b525c382..c0e5ee43 100644
--- a/test/lib/completions/vdir.exp
+++ b/test/lib/completions/vdir.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgcfgbackup.exp b/test/lib/completions/vgcfgbackup.exp
index 19ceeeca..b7e509a2 100644
--- a/test/lib/completions/vgcfgbackup.exp
+++ b/test/lib/completions/vgcfgbackup.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgcfgrestore.exp b/test/lib/completions/vgcfgrestore.exp
index e1c3c3b9..e40cd213 100644
--- a/test/lib/completions/vgcfgrestore.exp
+++ b/test/lib/completions/vgcfgrestore.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgchange.exp b/test/lib/completions/vgchange.exp
index 645eedb4..b6c0e1df 100644
--- a/test/lib/completions/vgchange.exp
+++ b/test/lib/completions/vgchange.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgck.exp b/test/lib/completions/vgck.exp
index 67209b15..b4d58aec 100644
--- a/test/lib/completions/vgck.exp
+++ b/test/lib/completions/vgck.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgconvert.exp b/test/lib/completions/vgconvert.exp
index 065c4828..362c44b6 100644
--- a/test/lib/completions/vgconvert.exp
+++ b/test/lib/completions/vgconvert.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgcreate.exp b/test/lib/completions/vgcreate.exp
index 7c324e62..4cb7dd45 100644
--- a/test/lib/completions/vgcreate.exp
+++ b/test/lib/completions/vgcreate.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgdisplay.exp b/test/lib/completions/vgdisplay.exp
index b6bc9125..6a8ed84d 100644
--- a/test/lib/completions/vgdisplay.exp
+++ b/test/lib/completions/vgdisplay.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgexport.exp b/test/lib/completions/vgexport.exp
index 2ad4230e..2900960f 100644
--- a/test/lib/completions/vgexport.exp
+++ b/test/lib/completions/vgexport.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgextend.exp b/test/lib/completions/vgextend.exp
index 18a491d2..3c46a8f0 100644
--- a/test/lib/completions/vgextend.exp
+++ b/test/lib/completions/vgextend.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgimport.exp b/test/lib/completions/vgimport.exp
index e4568f3b..ed04e282 100644
--- a/test/lib/completions/vgimport.exp
+++ b/test/lib/completions/vgimport.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgmerge.exp b/test/lib/completions/vgmerge.exp
index 8ba5e893..a4f8833b 100644
--- a/test/lib/completions/vgmerge.exp
+++ b/test/lib/completions/vgmerge.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgmknodes.exp b/test/lib/completions/vgmknodes.exp
index d24552f0..5c9feeb3 100644
--- a/test/lib/completions/vgmknodes.exp
+++ b/test/lib/completions/vgmknodes.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgreduce.exp b/test/lib/completions/vgreduce.exp
index 887ba8de..f6af3150 100644
--- a/test/lib/completions/vgreduce.exp
+++ b/test/lib/completions/vgreduce.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgremove.exp b/test/lib/completions/vgremove.exp
index 26dadf95..0dc5eda8 100644
--- a/test/lib/completions/vgremove.exp
+++ b/test/lib/completions/vgremove.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgrename.exp b/test/lib/completions/vgrename.exp
index 8ddaa758..81438631 100644
--- a/test/lib/completions/vgrename.exp
+++ b/test/lib/completions/vgrename.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgs.exp b/test/lib/completions/vgs.exp
index a27e3650..22ab176b 100644
--- a/test/lib/completions/vgs.exp
+++ b/test/lib/completions/vgs.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgscan.exp b/test/lib/completions/vgscan.exp
index 4bb8c35e..ae8168c8 100644
--- a/test/lib/completions/vgscan.exp
+++ b/test/lib/completions/vgscan.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vgsplit.exp b/test/lib/completions/vgsplit.exp
index 54e7034f..b183cfda 100644
--- a/test/lib/completions/vgsplit.exp
+++ b/test/lib/completions/vgsplit.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/vncviewer.exp b/test/lib/completions/vncviewer.exp
index 3d47f49f..8c51e0b2 100644
--- a/test/lib/completions/vncviewer.exp
+++ b/test/lib/completions/vncviewer.exp
@@ -1,13 +1,13 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {
/declare -f _vncviewer_bootstrap/d
}
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/wc.exp b/test/lib/completions/wc.exp
index 8ad2bf8d..b261b6a7 100644
--- a/test/lib/completions/wc.exp
+++ b/test/lib/completions/wc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {wc --help} "" "" "unsupported"]} {
assert_complete_any "wc --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/webmitm.exp b/test/lib/completions/webmitm.exp
index 1d48a3a6..adb97cc2 100644
--- a/test/lib/completions/webmitm.exp
+++ b/test/lib/completions/webmitm.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/wget.exp b/test/lib/completions/wget.exp
index 245b27be..8e830a12 100644
--- a/test/lib/completions/wget.exp
+++ b/test/lib/completions/wget.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/who.exp b/test/lib/completions/who.exp
index 73928ef7..6cca6795 100644
--- a/test/lib/completions/who.exp
+++ b/test/lib/completions/who.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
@@ -13,7 +13,7 @@ setup
if {[assert_exec {who --help} "" "" "unsupported"]} {
assert_complete_any "who --"
-}; # if
+}
sync_after_int
diff --git a/test/lib/completions/withlist.exp b/test/lib/completions/withlist.exp
index 6310466d..e1f91f6a 100644
--- a/test/lib/completions/withlist.exp
+++ b/test/lib/completions/withlist.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/wol.exp b/test/lib/completions/wol.exp
index 84a2d88d..a4ac9e4e 100644
--- a/test/lib/completions/wol.exp
+++ b/test/lib/completions/wol.exp
@@ -1,14 +1,14 @@
proc setup {} {
# See fixtures/shared/bin/{arp,ifconfig}
- assert_bash_exec {OLDPATH="$PATH"; PATH="$TESTDIR/fixtures/shared/bin:$PATH";}
+ assert_bash_exec {OLDPATH="$PATH"; PATH="$SRCDIR/fixtures/shared/bin:$PATH";}
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
assert_bash_exec {PATH="$OLDPATH"; unset -v OLDPATH}
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/wtf.exp b/test/lib/completions/wtf.exp
index 8250becc..b1693c80 100644
--- a/test/lib/completions/wtf.exp
+++ b/test/lib/completions/wtf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/wvdial.exp b/test/lib/completions/wvdial.exp
index 8d4669de..5b52daa8 100644
--- a/test/lib/completions/wvdial.exp
+++ b/test/lib/completions/wvdial.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xfreerdp.exp b/test/lib/completions/xfreerdp.exp
new file mode 100644
index 00000000..f61cfcad
--- /dev/null
+++ b/test/lib/completions/xfreerdp.exp
@@ -0,0 +1,28 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+set test "Tab should complete options"
+set cmd "xfreerdp --"
+send "$cmd\t"
+set expected "^$cmd\r\n--data.*--kbd-list.*--plugin\r\n/@$cmd$"
+expect {
+ -re $expected { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xhost.exp b/test/lib/completions/xhost.exp
index aeceadb6..82e2e9c6 100644
--- a/test/lib/completions/xhost.exp
+++ b/test/lib/completions/xhost.exp
@@ -1,24 +1,19 @@
proc setup {} {
assert_bash_exec {HOME=$TESTDIR}
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
set test "Tab should complete hostnames"
- # Build string list of hostnames
-set hosts {}
-foreach h [exec bash -c "compgen -A hostname"] {
- lappend hosts $h
-}; # foreach
-assert_complete $hosts "xhost " $test
+assert_complete [get_hosts] "xhost " $test
sync_after_int
@@ -28,13 +23,13 @@ set test "Tab should complete partial hostname"
# Build string list of hostnames, starting with the character of the first hostname
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"} {
lappend hosts $h
- }; # if
-}; # foreach
+ }
+}
assert_complete $hosts "xhost $char" $test
@@ -44,9 +39,9 @@ sync_after_int
set test "Tab should complete hostnames prefixed with +"
# Build string list of hostnames, prefixed with plus (+)
set hosts {}
-foreach h [exec bash -c "compgen -A hostname"] {
+foreach h [get_hosts] {
lappend hosts "+$h"
-}; # foreach
+}
assert_complete $hosts "xhost \+" $test
@@ -56,13 +51,13 @@ sync_after_int
set test "Tab should complete partial hostname prefixed with +"
# Build string list of hostnames, starting with character of first host.
set hosts {}
-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"} {
lappend hosts "+$h"
- }; # if
-}; # foreach
+ }
+}
assert_complete $hosts "xhost +$char"
@@ -72,9 +67,9 @@ sync_after_int
set test "Tab should complete hostnames prefixed with -"
# Build string list of hostnames, prefix with minus (-)
set hosts {}
-foreach h [exec bash -c "compgen -A hostname"] {
+foreach h [get_hosts] {
lappend hosts "-$h"
-}; # foreach
+}
assert_complete $hosts "xhost -" $test
@@ -84,13 +79,13 @@ sync_after_int
set test "Tab should complete partial hostname prefixed with -"
# Build list of hostnames, starting with character of first host
set hosts {}
-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"} {
lappend hosts "-$h"
- }; # if
-}; # foreach
+ }
+}
assert_complete $hosts "xhost -$char" $test
diff --git a/test/lib/completions/xmllint.exp b/test/lib/completions/xmllint.exp
index 15451471..20daab6d 100644
--- a/test/lib/completions/xmllint.exp
+++ b/test/lib/completions/xmllint.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xmlwf.exp b/test/lib/completions/xmlwf.exp
index a996d458..6c306f34 100644
--- a/test/lib/completions/xmlwf.exp
+++ b/test/lib/completions/xmlwf.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xmms.exp b/test/lib/completions/xmms.exp
index c4ad64e8..1f1f6d57 100644
--- a/test/lib/completions/xmms.exp
+++ b/test/lib/completions/xmms.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xmodmap.exp b/test/lib/completions/xmodmap.exp
new file mode 100644
index 00000000..2bf4da1c
--- /dev/null
+++ b/test/lib/completions/xmodmap.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "xmodmap "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xpovray.exp b/test/lib/completions/xpovray.exp
index 92cc903d..53a5fcd0 100644
--- a/test/lib/completions/xpovray.exp
+++ b/test/lib/completions/xpovray.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xrandr.exp b/test/lib/completions/xrandr.exp
index 649ed43b..14beb762 100644
--- a/test/lib/completions/xrandr.exp
+++ b/test/lib/completions/xrandr.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xrdb.exp b/test/lib/completions/xrdb.exp
new file mode 100644
index 00000000..f02625dc
--- /dev/null
+++ b/test/lib/completions/xrdb.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "xrdb "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xsltproc.exp b/test/lib/completions/xsltproc.exp
index 2470c22e..2c558ff1 100644
--- a/test/lib/completions/xsltproc.exp
+++ b/test/lib/completions/xsltproc.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xvnc4viewer.exp b/test/lib/completions/xvnc4viewer.exp
index 3456c3e7..b10e272c 100644
--- a/test/lib/completions/xvnc4viewer.exp
+++ b/test/lib/completions/xvnc4viewer.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/xz.exp b/test/lib/completions/xz.exp
index 820b0689..6e6b29ca 100644
--- a/test/lib/completions/xz.exp
+++ b/test/lib/completions/xz.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
- assert_env_unmodified
-}; # teardown()
+ assert_env_unmodified {/OLDPWD=/d}
+}
setup
@@ -17,14 +17,14 @@ assert_complete_any "xz "
sync_after_int
-assert_complete "a/ bashcomp.lzma bashcomp.tar.xz bashcomp.tlz bashcomp.xz" \
- "xz -d fixtures/xz/"
+assert_complete_dir "a/ bashcomp.lzma bashcomp.tar.xz bashcomp.tlz bashcomp.xz" \
+ "xz -d " $::srcdir/fixtures/xz
sync_after_int
-assert_complete "a/ bashcomp.tar" "xz fixtures/xz/"
+assert_complete_dir "a/ bashcomp.tar" "xz " $::srcdir/fixtures/xz
sync_after_int
diff --git a/test/lib/completions/ypcat.exp b/test/lib/completions/ypcat.exp
index f1bd0c0e..a8249dc2 100644
--- a/test/lib/completions/ypcat.exp
+++ b/test/lib/completions/ypcat.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/ypmatch.exp b/test/lib/completions/ypmatch.exp
index f1695f67..ac264c18 100644
--- a/test/lib/completions/ypmatch.exp
+++ b/test/lib/completions/ypmatch.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/yum-arch.exp b/test/lib/completions/yum-arch.exp
index defb7bf4..85c47c22 100644
--- a/test/lib/completions/yum-arch.exp
+++ b/test/lib/completions/yum-arch.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/completions/yum.exp b/test/lib/completions/yum.exp
index 09d7282c..899ecddb 100644
--- a/test/lib/completions/yum.exp
+++ b/test/lib/completions/yum.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified
-}; # teardown()
+}
setup
diff --git a/test/lib/library.exp b/test/lib/library.exp
index c76d9854..491da212 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -1,7 +1,8 @@
- # Source `init.tcl' again to restore the `unknown' procedure
- # NOTE: DejaGnu has an old `unknown' procedure which unfortunately disables
- # tcl auto-loading.
+# Source `init.tcl' again to restore the `unknown' procedure
+# NOTE: DejaGnu has an old `unknown' procedure which unfortunately disables
+# tcl auto-loading.
source [file join [info library] init.tcl]
+package require cmdline
package require textutil::string
@@ -22,7 +23,7 @@ proc assert_bash_exec {{aCmd ""} {title ""} {prompt /@} {out -1}} {
if {[string length $aCmd] != 0} {
send "$aCmd\r"
expect -ex "$aCmd\r\n"
- }; # if
+ }
if {[string length $title] == 0} {set title $aCmd}
expect -ex $prompt
set results $expect_out(buffer); # Catch output
@@ -33,24 +34,16 @@ proc assert_bash_exec {{aCmd ""} {title ""} {prompt /@} {out -1}} {
]
]
if {$out == -1 && [string length $results] > 0} {
- if {[info exists multipass_name]} {
- fail "ERROR Unexpected output from bash command \"$title\""
- }; # if
- send_user "ERROR Unexpected output from bash command \"$title\":\n$results"
- }; # if
+ fail "ERROR Unexpected output from bash command \"$title\""
+ }
set cmd "echo $?"
send "$cmd\r"
expect {
-ex "$cmd\r\n0\r\n$prompt" {}
- $prompt {
- if {[info exists multipass_name]} {
- fail "ERROR executing bash command \"$title\""
- }; # if
- send_user "ERROR executing bash command \"$title\""
- }
- }; # expect
-}; # assert_bash_exec()
+ $prompt {fail "ERROR executing bash command \"$title\""}
+ }
+}
# Test `type ...' in bash
@@ -64,32 +57,45 @@ proc assert_bash_type {command} {
expect {
-ex 0 { set result true }
-ex 1 { set result false; unsupported "$test" }
- }; # expect
+ }
expect "/@"
return $result
-}; # assert_bash_type()
+}
-# Make sure the expected list is returned by executing the specified command.
-# @param list $expected
-# @param string $cmd Command given to generate items
-# @param string $test (optional) Test title. Default is "$cmd<TAB> should show completions"
-# @param string $prompt (optional) Bash prompt. Default is "/@"
-# @param integer $size (optional) Chunk size. Default is 20.
-# @result boolean True if successful, False if not
-proc assert_bash_list {expected cmd {test ""} {prompt /@} {size 20}} {
+# Make sure the expected list matches the real list, as returned by executing
+# the specified bash command.
+# Specify `-sort' if the real list is sorted.
+# @param list $expected Expected list items
+# @param string $cmd Bash command to execute in order to generate real list
+# items
+# @param string $test Test title. Becomes "$cmd should show expected output"
+# if empty string.
+# @param list $args Options:
+# -sort Compare list sorted. Default is unsorted
+# -prompt Bash prompt. Default is `/@'
+# -chunk-size N Compare list N items at a time. Default
+# is 20.
+proc assert_bash_list {expected cmd test {args {}}} {
+ array set arg [::cmdline::getoptions args {
+ {sort "compare list sorted"}
+ {prompt.arg /@ "bash prompt"}
+ {chunk-size.arg 20 "compare N list items at a time"}
+ }]
+ set prompt $arg(prompt)
if {$test == ""} {set test "$cmd should show expected output"}
if {[llength $expected] == 0} {
assert_no_output $cmd $test $prompt
} else {
send "$cmd\r"
expect -ex "$cmd\r\n"
-
- if {[match_items $expected $test $prompt $size]} {
- expect {
- -re $prompt { pass "$test" }
- -re eof { unresolved "eof" }
- }
+ if {$arg(sort)} {set bash_sort "-bash-sort"} {set bash_sort ""}
+ if {[
+ eval match_items \$expected $bash_sort -chunk-size \
+ \$arg(chunk-size) -end-newline -end-prompt \
+ -prompt \$prompt
+ ]} {
+ pass "$test"
} else {
fail "$test"
}
@@ -97,130 +103,235 @@ proc assert_bash_list {expected cmd {test ""} {prompt /@} {size 20}} {
}
-proc assert_bash_list_dir {expected cmd dir {test ""} {prompt /@} {size 20}} {
- set prompt "/$dir/@"
+# Make sure the expected list matches the real list, as returned by executing
+# the specified bash command within the specified directory.
+# Specify `-sort' if the real list is sorted.
+# @param list $expected Expected list items
+# @param string $cmd Bash command to generate real list items
+# @param string $dir Directory to execute $cmd within
+# @param string $test Test title. Becomes "$cmd should show expected output"
+# if empty string.
+# @param list $args Options:
+# -sort Compare list sorted. Default is unsorted
+# -prompt Bash prompt. Default is `/@'
+# -chunk-size N Compare list N items at a time. Default
+# is 20.
+proc assert_bash_list_dir {expected cmd dir test {args {}}} {
+ array set arg [::cmdline::getoptions args {
+ {sort "compare list sorted"}
+ {prompt.arg "/@" "bash prompt"}
+ {chunk-size.arg 20 "compare N list items at a time"}
+ }]
+ set prompt $arg(prompt)
+ if {$arg(sort)} {set arg_sort "-sort"} else {set arg_sort ""}
assert_bash_exec "cd $dir" "" $prompt
- assert_bash_list $expected $cmd $test $prompt $size
+ assert_bash_list $expected $cmd $test $arg_sort \
+ -chunk-size $arg(chunk-size) -prompt $prompt
sync_after_int $prompt
assert_bash_exec {cd "$TESTDIR"}
-}; # assert_bash_list_dir()
+}
# Make sure the expected items are returned by TAB-completing the specified
-# command.
+# command. If the number of expected items is one, expected is:
+#
+# $cmd<TAB>$expected[<SPACE>]
+#
+# SPACE is not expected if -nospace is specified.
+#
+# If the number of expected items is greater than one, expected is:
+#
+# $cmd<TAB>\n
+# $expected\n
+# $prompt + ($cmd - AUTO) + longest-common-prefix-of-$expected
+#
+# AUTO is calculated like this: If $cmd ends with non-whitespace, and
+# the last argument of $cmd equals the longest-common-prefix of
+# $expected, $cmd minus this argument will be expected.
+#
+# If the algorithm above fails, you can manually specify the CWORD to be
+# subtracted from $cmd specifying `-expect-cmd-minus CWORD'. Known cases where
+# this is useful are when:
+# - the last whitespace is escaped, e.g. "finger foo\ " or "finger
+# 'foo "
+#
+# If the entire $cmd is expected, specify `-expect-cmd-full'.
+#
# @param list $expected Expected completions.
# @param string $cmd Command given to generate items
-# @param string $test (optional) Test title. Default is "$cmd<TAB> should show completions"
-# @param string $prompt (optional) Bash prompt. Default is "/@"
-# @param integer $size (optional) Chunk size. Default is 20.
-# @param string $cword (optional) Last argument of $cmd which is an
-# argument-to-complete and to be replaced with the longest common prefix
-# of $expected. If empty string (default), `assert_complete' autodetects
-# if the last argument is an argument-to-complete by checking if $cmd
-# doesn't end with whitespace. Specifying `cword' should only be necessary
-# if this autodetection fails, e.g. when the last whitespace is escaped or
-# quoted, e.g. "finger foo\ " or "finger 'foo "
-# @param list $filters (optional) List of filters to apply to this function to tweak
-# the expected completions and argument-to-complete. Possible values:
-# - "ltrim_colon_completions"
-# @result boolean True if successful, False if not
-proc assert_complete {expected cmd {test ""} {prompt /@} {size 20} {cword ""} {filters ""}} {
+# @param string $test Test title
+# @param list $args Options:
+# -prompt PROMPT Bash prompt. Default is `/@'
+# -chunk-size CHUNK-SIZE Compare list CHUNK-SIZE items at
+# a time. Default is 20.
+# -nospace Don't expect space character to be output after completion match.
+# Valid only if a single completion is expected.
+# -ltrim-colon-completions Left-trim completions with cword containing
+# colon (:)
+# -expect-cmd-full Expect the full $cmd to be echoed. Expected is:
+#
+# $cmd<TAB>\n
+# $expected\n
+# $prompt + $cmd + longest-common-prefix-of-$expected
+#
+# -expect-cmd-minus DWORD Expect $cmd minus DWORD to be echoed.
+# Expected is:
+#
+# $cmd<TAB>\n
+# $expected\n
+# $prompt + ($cmd - DWORD) + longest-common-prefix-of-$expected
+#
+proc assert_complete {expected cmd {test ""} {args {}}} {
+ set args_orig $args
+ array set arg [::cmdline::getoptions args {
+ {prompt.arg "/@" "bash prompt"}
+ {chunk-size.arg 20 "compare N list items at a time"}
+ {nospace "don't expect space after completion"}
+ {ltrim-colon-completions "left-trim completions with cword containing :"}
+ {expect-cmd-full "Expect full cmd after prompt"}
+ {expect-cmd-minus.arg "" "Expect cmd minus DWORD after prompt"}
+ }]
if {[llength $expected] == 0} {
assert_no_complete $cmd $test
+ } elseif {[llength $expected] == 1} {
+ eval assert_complete_one \$expected \$cmd \$test $args_orig
} else {
- if {$test == ""} {set test "$cmd should show completions"}
- send "$cmd\t"
- if {[llength $expected] == 1} {
- expect -ex "$cmd"
-
- if {[lsearch -exact $filters "ltrim_colon_completions"] == -1} {
- set cur ""; # Default to empty word to complete on
- set words [split_words_bash $cmd]
- if {[llength $words] > 1} {
- # Assume last word of `$cmd' is word to complete on.
- set index [expr [llength $words] - 1]
- set cur [lindex $words $index]
- }; # if
- # Remove second word from beginning of single item $expected
- if {[string first $cur $expected] == 0} {
- set expected [list [string range $expected [string length $cur] end]]
- }; # if
- }; # if
- } else {
- expect -ex "$cmd\r\n"
- # Make sure expected items are unique
- set expected [lsort -unique $expected]
- }; # if
-
- if {[lsearch -exact $filters "ltrim_colon_completions"] != -1} {
- # If partial contains colon (:), remove partial from begin of items
- # See also: bash_completion.__ltrim_colon_completions()
- _ltrim_colon_completions cword expected
- }; # if
-
- if {[match_items $expected $test $prompt $size]} {
- if {[llength $expected] == 1} {
- pass "$test"
- } else {
- # Remove optional (partial) last argument-to-complete from `cmd',
- # E.g. "finger test@" becomes "finger"
-
- if {[lsearch -exact $filters "ltrim_colon_completions"] != -1} {
- set cmd2 $cmd
- } else {
- set cmd2 [_remove_cword_from_cmd $cmd $cword]
- }; # if
-
- # Determine common prefix of completions
- set common [::textutil::string::longestCommonPrefixList $expected]
- #if {[string length $common] > 0} {set common " $common"}
- expect {
- -ex "$prompt$cmd2$common" { pass "$test" }
- -re $prompt { unresolved "$test at prompt" }
- -re eof { unresolved "eof" }
- }; # expect
- }; # if
- } else {
- fail "$test"
- }; # if
- }; # if
-}; # assert_complete()
+ eval assert_complete_many \$expected \$cmd \$test $args_orig
+ }
+}
+
+
+# Make sure the expected multiple items are returned by TAB-completing the
+# specified command.
+# @see assert_complete()
+proc assert_complete_many {expected cmd {test ""} {args {}}} {
+ array set arg [::cmdline::getoptions args {
+ {prompt.arg "/@" "bash prompt"}
+ {chunk-size.arg 20 "compare N list items at a time"}
+ {nospace "don't expect space after completion"}
+ {ltrim-colon-completions "left-trim completions with cword containing :"}
+ {expect-cmd-full "Expect full cmd after prompt"}
+ {expect-cmd-minus.arg "" "Expect cmd minus CWORD after prompt"}
+ }]
+ if {$test == ""} {set test "$cmd should show completions"}
+ set prompt $arg(prompt)
+ set dword ""
+ if {$arg(expect-cmd-minus) != ""} {set dword $arg(expect-cmd-minus)}
+
+ send "$cmd\t"
+ expect -ex "$cmd\r\n"
+ # Make sure expected items are unique
+ set expected [lsort -unique $expected]
-# @param string $cmd Command to remove cword from
-# @param string $cword (optional) Last argument of $cmd which is an
-# argument-to-complete and to be deleted. If empty string (default),
-# `_remove_cword_from_cmd' autodetects if the last argument is an
-# argument-to-complete by checking if $cmd doesn't end with whitespace.
-# Specifying `cword' is only necessary if this autodetection fails, e.g.
+ # Determine common prefix of completions
+ set common [::textutil::string::longestCommonPrefixList $expected]
+
+ if {$arg(ltrim-colon-completions)} {
+ # If partial contains colon (:), remove partial from begin of items
+ _ltrim_colon_completions $cmd expected dword
+ }
+ set cmd2 [_remove_cword_from_cmd $cmd $dword $common]
+
+ set prompt "$prompt$cmd2$common"
+ if {$arg(nospace)} {set endspace ""} else {set endspace "-end-space"}
+ set endprompt "-end-prompt"
+ if {[
+ eval match_items \$expected -bash-sort -chunk-size \
+ \$arg(chunk-size) $endprompt $endspace -prompt \$prompt
+ ]} {
+ pass "$test"
+ } else {
+ fail "$test"
+ }
+}
+
+
+# Make sure the expected single item is returned by TAB-completing the
+# specified command.
+# @see assert_complete()
+proc assert_complete_one {expected cmd {test ""} {args {}}} {
+ array set arg [::cmdline::getoptions args {
+ {prompt.arg "/@" "bash prompt"}
+ {chunk-size.arg 20 "compare N list items at a time"}
+ {nospace "don't expect space after completion"}
+ {ltrim-colon-completions "left-trim completions with cword containing :"}
+ {expect-cmd-full "Expect full cmd after prompt"}
+ {expect-cmd-minus.arg "" "Expect cmd minus CWORD after prompt"}
+ }]
+ set prompt $arg(prompt)
+
+ if {$test == ""} {set test "$cmd should show completion"}
+ send "$cmd\t"
+ expect -ex "$cmd"
+ if {$arg(ltrim-colon-completions)} {
+ # If partial contains colon (:), remove partial from begin of items
+ _ltrim_colon_completions $cmd expected cword
+ } else {
+ set cur ""; # Default to empty word to complete on
+ set words [split_words_bash $cmd]
+ if {[llength $words] > 1} {
+ # Assume last word of `$cmd' is word to complete on.
+ set index [expr [llength $words] - 1]
+ set cur [lindex $words $index]
+ }
+ # Remove second word from beginning of $expected
+ if {[string first $cur $expected] == 0} {
+ set expected [list [string range $expected [string length $cur] end]]
+ }
+ }
+
+ if {$arg(nospace)} {set endspace ""} else {set endspace "-end-space"}
+ if {[
+ eval match_items \$expected -bash-sort -chunk-size \
+ \$arg(chunk-size) $endspace -prompt \$prompt
+ ]} {
+ pass "$test"
+ } else {
+ fail "$test"
+ }
+}
+
+
+# @param string $cmd Command to remove current-word-to-complete from.
+# @param string $dword (optional) Manually specify current-word-to-complete,
+# i.e. word to remove from $cmd. If empty string (default),
+# `_remove_cword_from_cmd' autodetects if the last argument is the
+# current-word-to-complete by checking if $cmd doesn't end with whitespace.
+# Specifying `dword' is only necessary if this autodetection fails, e.g.
# when the last whitespace is escaped or quoted, e.g. "finger foo\ " or
# "finger 'foo "
-# @return string Command with cword removed
-proc _remove_cword_from_cmd {cmd {cword ""}} {
+# @param string $common (optional) Common prefix of expected completions.
+# @return string Command with current-word-to-complete removed
+proc _remove_cword_from_cmd {cmd {dword ""} {common ""}} {
set cmd2 $cmd
- # Is $cword specified?
- if {[string length $cword] > 0} {
- # Remove $cword from end of $cmd
- if {[string last $cword $cmd] == [string length $cmd] - [string length $cword]} {
- set cmd2 [string range $cmd 0 [expr [string last $cword $cmd] - 1]]
- }; # if
+ # Is $dword specified?
+ if {[string length $dword] > 0} {
+ # Remove $dword from end of $cmd
+ if {[string last $dword $cmd] == [string length $cmd] - [string length $dword]} {
+ set cmd2 [string range $cmd 0 [expr [string last $dword $cmd] - 1]]
+ }
} else {
- # No, $cword not specified;
- # Check if last argument is really an-argument-to-complete, i.e.
+ # No, $dword not specified;
+ # Check if last argument is really a word-to-complete, i.e.
# doesn't end with whitespace.
# NOTE: This check fails if trailing whitespace is escaped or quoted,
# e.g. "finger foo\ " or "finger 'foo ". Specify parameter
- # $cword in those cases.
+ # $dword in those cases.
# Is last char whitespace?
if {! [string is space [string range $cmd end end]]} {
# No, last char isn't whitespace;
- # Remove argument-to-complete from end of $cmd
- set cmd2 [lrange [split $cmd] 0 end-1]
- append cmd2 " "
- }; # if
- }; # if
+ set cmds [split $cmd]
+ # Does word-to-complete start with $common?
+ if {[string first $common [lrange $cmds end end]] == 0} {
+ # Remove word-to-complete from end of $cmd
+ set cmd2 [lrange $cmds 0 end-1]
+ append cmd2 " "
+ }
+ }
+ }
return $cmd2
-}; # _remove_cword_from_cmd()
+}
# Escape regexp special characters
@@ -253,8 +364,8 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} {
}
-re $prompt { unresolved "$test at prompt" }
eof { unresolved "eof" }
- }; # expect
-}; # assert_complete_any()
+ }
+}
# Make sure the expected files are returned by TAB-completing the
@@ -262,18 +373,16 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} {
# @param list $expected
# @param string $cmd Command given to generate items
# @param string $dir Subdirectory to attempt completion in. The directory must be relative from the $TESTDIR and without a trailing slash. E.g. `fixtures/evince'
-# @param string $test (optional) Test title. Default is "$cmd<TAB> should show completions"
-# @param string $prompt (optional) Bash prompt. Default is "/@"
-# @param integer $size (optional) Chunk size. Default is 20.
-# @param string $cword (optional) Last word of $cmd to complete. See: assert_complete()
+# @param string $test Test title
+# @param list $args See: assert_complete()
# @result boolean True if successful, False if not
-proc assert_complete_dir {expected cmd dir {test ""} {size 20} {cword ""}} {
- set prompt "/$dir/@"
+proc assert_complete_dir {expected cmd dir {test ""} {args {}}} {
+ set prompt "/@"
assert_bash_exec "cd $dir" "" $prompt
- assert_complete $expected $cmd $test $prompt $size $cword
+ assert_complete $expected $cmd $test $args
sync_after_int $prompt
assert_bash_exec {cd "$TESTDIR"}
-}; # assert_complete_dir
+}
@@ -284,14 +393,9 @@ proc assert_complete_dir {expected cmd dir {test ""} {size 20} {cword ""}} {
# @param list $expected List of all completions.
# @param string $cmd Command given to generate items
# @param string $partial Word to complete
-# @param string $test (optional) Test title. Default is "$cmd<TAB> should show completions"
-# @param string $prompt (optional) Bash prompt. Default is "/@"
-# @param integer $size (optional) Chunk size. Default is 20.
-# @param list $filters (optional) List of filters to apply to this function to tweak
-# the expected completions and argument-to-complete.
-# @see assert_complete()
-# @result boolean True if successful, False if not
-proc assert_complete_partial {expected cmd {partial ""} {test ""} {prompt /@} {size 20} {filters ""}} {
+# @param string $test Test title
+# @param list $args See: assert_complete()
+proc assert_complete_partial {expected cmd {partial ""} {test ""} {args {}}} {
if {$test == ""} {set test "$cmd should complete partial argument"}
if {[llength $expected] == 0} {
unresolved "$test"
@@ -301,39 +405,54 @@ proc assert_complete_partial {expected cmd {partial ""} {test ""} {prompt /@} {s
set expected [lsort -unique $expected]
foreach item $expected {
if {$partial == ""} {set partial [string range $item 0 0]}
- # Only append item if starting with $partial
+ # Only append item if starting with $partial
if {[string range $item 0 [expr [string length $partial] - 1]] == "$partial"} {
lappend pick $item
- }; # if
- }; # foreach
- assert_complete $pick "$cmd $partial" $test $prompt $size $partial $filters
- }; # if
-}; # assert_complete_partial()
+ }
+ }
+ # NOTE: The `eval' is necessary to flatten the $args list
+ # See also: http://wiki.tcl.tk/11787 - {expand}
+ eval assert_complete \$pick \"\$cmd \$partial\" \$test $args; #"
+ }
+}
+# If cword contains colon (:), left-trim completions with cword
+# @param string $cmd Command to complete
+# @param list $items Reference to list of completions to trim
+# @param string $dword Reference to variable to contain word to remove from
+# expected cmd.
# See also: bash_completion._ltrim_colon_completions
-proc _ltrim_colon_completions {cword items} {
- upvar 1 $cword cword_out
+proc _ltrim_colon_completions {cmd items dword} {
upvar 1 $items items_out
+ upvar 1 $dword dword_out
+
+ set cur ""; # Default to empty word to complete on
+ set words [split_words_bash $cmd]
+ if {[llength $words] > 1} {
+ # Assume last word of `$cmd' is word to complete on.
+ set index [expr [llength $words] - 1]
+ set cur [lindex $words $index]
+ }
# If word-to-complete contains a colon,
# and bash-version < 4,
# or bash-version >= 4 and COMP_WORDBREAKS contains a colon
if {
- [string first : $cword_out] > -1 && (
+ [string first : $cur] > -1 && (
[lindex $::BASH_VERSINFO 0] < 4 ||
([lindex $::BASH_VERSINFO 0] >= 4 && [string first ":" $::COMP_WORDBREAKS] > -1)
)
} {
+ set dword_out $cur
for {set i 0} {$i < [llength $items_out]} {incr i} {
set item [lindex $items_out $i]
- if {[string first $cword_out $item] == 0} {
+ if {[string first $cur $item] == 0} {
# Strip colon-prefix
- lset items_out $i [string range $item [string length $cword_out] end]
- }; # if
- }; # for
- #set cword_out ""
- }; # if
-}; # _ltrim_colon_completions()
+ lset items_out $i [string range $item [string length $cur] end]
+ }
+ }
+ }
+}
# Make sure the bash environment hasn't changed between now and the last call
@@ -370,7 +489,7 @@ proc assert_env_unmodified {{sed ""} {file ""} {diff ""}} {
append diff "\r\n"
} else {
set diff ""
- }; # if
+ }
# Execute diff
@@ -392,11 +511,11 @@ proc assert_env_unmodified {{sed ""} {file ""} {diff ""}} {
# Remove possible `\r\n[wd]@' from end of diff
if {[string last "\r\n[wd]@" $diff] == [string length $diff] - [string length "\r\n[wd]@"]} {
set diff [string range $diff 0 [expr [string last "\r\n[wd]@" $diff] - 1]]
- }; # if
+ }
send_user $diff;
}
- }; # expect
-}; # assert_env_unmodified()
+ }
+}
# Make sure the specified command executed from within Tcl/Expect.
@@ -426,10 +545,10 @@ proc assert_exec {cmd {stdout ''} {test ''} {failcmd "unresolved"}} {
unsupported "$test"
} else {
$failcmd "$test"
- }; # if
- }; # if
+ }
+ }
return $result
-}; # assert_exec()
+}
# Check that no completion is attempted on a certain command.
@@ -439,7 +558,7 @@ proc assert_exec {cmd {stdout ''} {test ''} {failcmd "unresolved"}} {
proc assert_no_complete {{cmd} {test ""}} {
if {[string length $test] == 0} {
set test "$cmd shouldn't complete"
- }; # if
+ }
send "$cmd\t"
expect -ex "$cmd"
@@ -451,8 +570,8 @@ proc assert_no_complete {{cmd} {test ""}} {
-re "^$endguard$" { pass "$test" }
default { fail "$test" }
timeout { fail "$test" }
- }; # expect
-}; # assert_no_complete()
+ }
+}
# Check that no output is generated on a certain command.
@@ -483,7 +602,7 @@ proc assert_no_output {{cmd} {test ""} {prompt /@}} {
proc assert_source_completions {command {file ""}} {
if {[is_bash_completion_installed_for $command]} {
if {[string length $file] == 0} {
- set file "lib/completions/$command.exp"
+ set file "$::srcdir/lib/completions/$command.exp"
}
source $file
} else {
@@ -510,23 +629,23 @@ proc get_known_hosts {{cword ''}} {
assert_bash_exec "_known_hosts_real '$cword'; echo_array COMPREPLY" \
{} /@ result
return $result
-}; # get_known_hosts()
+}
# Get hostnames
# @return list Hostnames
# @see get_known_hosts()
proc get_hosts {} {
- set hosts [exec bash -c "compgen -A hostname"]
+ set hosts [exec bash -c "compgen -A hostname | sort -u"]
# NOTE: Circumventing var `avahi_hosts' and appending directly to `hosts'
# causes an empty element to be inserted in `hosts'.
# -- FVu, Fri Jul 17 23:11:46 CEST 2009
set avahi_hosts [get_hosts_avahi]
if {[llength $avahi_hosts] > 0} {
lappend hosts $avahi_hosts
- }; # if
+ }
return $hosts
-}; # get_hosts()
+}
# Get hostnames according to avahi
@@ -540,9 +659,9 @@ proc get_hosts_avahi {} {
# No, retrieving hosts yields error;
# Reset hosts
set hosts {}
- }; # if
+ }
return $hosts
-}; # get_hosts_avahi()
+}
# Get signals
@@ -558,21 +677,22 @@ proc get_signals {} {
set signal [string range $signal 3 end]
# Add signal (with dash (-) prefix) to list
lappend signals -$signal
- }; # if
- }; # foreach
+ }
+ }
return $signals
-}; # get_signals()
+}
# Initialize tcl globals with bash variables
proc init_tcl_bash_globals {} {
- global BASH_VERSINFO BASH_VERSION COMP_WORDBREAKS
+ global BASH_VERSINFO BASH_VERSION COMP_WORDBREAKS LC_CTYPE
assert_bash_exec {printf "%s" "$COMP_WORDBREAKS"} {} /@ COMP_WORDBREAKS
assert_bash_exec {printf "%s " "${BASH_VERSINFO[@]}"} "" /@ BASH_VERSINFO
set BASH_VERSINFO [eval list $BASH_VERSINFO]
assert_bash_exec {printf "%s" "$BASH_VERSION"} "" /@ BASH_VERSION
assert_bash_exec {printf "%s" "$TESTDIR"} "" /@ TESTDIR
-}; # init_tcl_bash_globals()
+ assert_bash_exec {eval $(locale); printf "%s" "$LC_CTYPE"} "" /@ LC_CTYPE
+}
# Check whether completion is installed for the specified command by executing
@@ -590,22 +710,44 @@ proc is_bash_completion_installed_for {command} {
}
expect "/@"
return $result
-}; # is_bash_completion_installed_for()
+}
# Detect if test suite is running under Cygwin/Windows
proc is_cygwin {} {
expr {[string first [string tolower [exec uname -s]] cygwin] >= 0}
-}; # is_cygwin()
+}
-# Expect items.
+# Expect items, a limited number (20) at a time.
# Break items into chunks because `expect' seems to have a limited buffer size
-# @param list $items
-# @param integer $size Chunk size
+# @param list $items Expected list items
+# @param list $args Options:
+# -bash-sort Compare list bash-sorted. Default is
+# unsorted
+# -prompt PROMPT Bash prompt. Default is `/@'
+# -chunk-size CHUNK-SIZE Compare list CHUNK-SIZE items at
+# a time. Default is 20.
+# -end-newline Expect newline after last item.
+# Default is not.
+# -end-prompt Expect prompt after last item.
+# Default is not.
+# -end-space Expect single space after last item.
+# Default is not. Valid only if
+# `end-newline' not set.
# @result boolean True if successful, False if not
-proc match_items {items test {prompt /@} {size 20}} {
- set items [bash_sort $items]
+proc match_items {items {args {}}} {
+ array set arg [::cmdline::getoptions args {
+ {bash-sort "compare list sorted"}
+ {prompt.arg "/@" "bash prompt"}
+ {chunk-size.arg 20 "compare N list items at a time"}
+ {end-newline "expect newline after last item"}
+ {end-prompt "expect prompt after last item"}
+ {end-space "expect space ater last item"}
+ }]
+ set prompt $arg(prompt)
+ set size $arg(chunk-size)
+ if {$arg(bash-sort)} {set items [bash_sort $items]}
set result false
for {set i 0} {$i < [llength $items]} {set i [expr {$i + $size}]} {
# For chunks > 1, allow leading whitespace
@@ -614,28 +756,43 @@ proc match_items {items test {prompt /@} {size 20}} {
set item "[lindex $items [expr {$i + $j}]]"
_escape_regexp_chars item
append expected $item
- if {[llength $items] > 1} {append expected {\s+}};
- }; # for
+ if {[llength $items] > 1} {append expected {\s+}}
+ }
if {[llength $items] == 1} {
+ if {$arg(end-prompt)} {set end $prompt} {set end ""}
+ # Both trailing space and newline are specified?
+ if {$arg(end-newline) && $arg(end-space)} {
+ # Indicate both trailing space or newline are ok
+ set expected2 "|^$expected $end$"; # Include space
+ append expected "\r\n$end"; # Include newline
+ } else {
+ if {$arg(end-newline)} {append expected "\r\n$end"}
+ if {$arg(end-space)} {append expected " $end"}
+ set expected2 ""
+ }
expect {
- -re "^$expected\r\n$" { set result true }
- # NOTE: The optional space ( ?) depends on whether -o nospace is active
- -re "^$expected ?$" { set result true }
+ -re "^$expected$$expected2" { set result true }
-re "^$prompt$" {set result false; break }
- "\r\n" { set result false; break }
default { set result false; break }
timeout { set result false; break }
- }; # expect
+ }
} else {
+ set end ""
+ if {$arg(end-prompt) && $i + $j == [llength $items]} {
+ set end "$prompt"
+ _escape_regexp_chars end
+ # \$ matches real end of expect_out buffer
+ set end "$end\$"
+ }
expect {
- -re "^$expected" { set result true }
+ -re "^$expected$end" { set result true }
default { set result false; break }
timeout { set result false; break }
- }; # expect
- }; # if
- }; # for
+ }
+ }
+ }
return $result
-}; # match_items()
+}
@@ -651,10 +808,10 @@ proc realcommand {cmd} {
set result [exec readlink -f $path]
} else {
set result $path
- }; # if
- }; # if
+ }
+ }
return $result
-}; # realcommand()
+}
# Generate filename to save environment to.
@@ -674,10 +831,10 @@ proc gen_env_filename {{file ""} {seq 1}} {
# Remove possible '.exp' suffix from filename
if {[string last ".exp" $file] == [string length $file] - [string length ".exp"]} {
set file [string range $file 0 [expr [string last ".exp" $file] - 1]]
- }; # if
- }; # if
+ }
+ }
return "\$TESTDIR/tmp/$file.env$seq~"
-}; # gen_env_filename()
+}
# Save the environment for later comparison
@@ -685,7 +842,7 @@ proc gen_env_filename {{file ""} {seq 1}} {
# `gen_env_filename()'.
proc save_env {{file ""}} {
_save_env [gen_env_filename $file 1]
-}; # save_env()
+}
# Save the environment for later comparison
@@ -693,16 +850,16 @@ proc save_env {{file ""}} {
# @see assert_env_unmodified()
proc _save_env {{file ""}} {
assert_bash_exec "{ set; declare -F; shopt -p; } > \"$file\""
-}; # _save_env()
+}
# Source bash_completion package
proc source_bash_completion {} {
- assert_bash_exec {BASH_COMPLETION_DIR=$(cd "$TESTDIR/.."; pwd)/contrib}
+ assert_bash_exec {BASH_COMPLETION_DIR=$(cd "$SRCDIR/.."; pwd)/completions}
assert_bash_exec {BASH_COMPLETION_COMPAT_DIR=$BASH_COMPLETION_DIR}
- assert_bash_exec {BASH_COMPLETION=$(cd "$TESTDIR/.."; pwd)/bash_completion}
+ assert_bash_exec {BASH_COMPLETION=$(cd "$SRCDIR/.."; pwd)/bash_completion}
assert_bash_exec {source "$BASH_COMPLETION"}
-}; # source_bash_completion()
+}
# Split line into words, disregarding backslash escapes (e.g. \b (backspace),
@@ -727,7 +884,7 @@ proc split_words_bash {line} {
set part [string range $part 0 [expr [string length $part] - [string length "\\"] - 1]]
# Indicate glue on next run
set glue_next true
- }; # if
+ }
# Must `part' be appended to latest word (= glue)?
if {[llength $words] > 0 && [string is true $glue]} {
# Yes, join `part' to latest word;
@@ -738,11 +895,11 @@ proc split_words_bash {line} {
# No, don't append word to latest word;
# Append `part' as separate word
lappend words $part
- }; # if
+ }
set glue $glue_next
- }; # foreach
+ }
return $words
-}; # split_words_bash()
+}
# Given a list of items this proc finds a (part, full) pair so that when
@@ -814,19 +971,22 @@ proc find_unique_completion_pair {{list} {partName} {fullName}} {
# Start bash running as test environment.
proc start_bash {} {
- global TESTDIR TOOL_EXECUTABLE spawn_id
+ global TESTDIR TOOL_EXECUTABLE spawn_id env srcdirabs
set TESTDIR [pwd]
+ set srcdirabs [file normalize $::srcdir]; # Absolute srcdir
# If `--tool_exec' option not specified, use "bash"
if {! [info exists TOOL_EXECUTABLE]} {set TOOL_EXECUTABLE bash}
- exp_spawn $TOOL_EXECUTABLE --rcfile config/bashrc
- assert_bash_exec {} "$TOOL_EXECUTABLE --rcfile config/bashrc"
+ set env(SRCDIR) $::srcdir
+ set env(SRCDIRABS) $::srcdirabs
+ exp_spawn $TOOL_EXECUTABLE --rcfile $::srcdir/config/bashrc
+ assert_bash_exec {} "$TOOL_EXECUTABLE --rcfile $::srcdir/config/bashrc"
# Bash < 3.2.41 has a bug where 'history' disappears from SHELLOPTS
# whenever a shopt setting is sourced or eval'ed. Disabling 'history'
# makes it not show in tests "Environment should not be modified"
# for bash < 3.2.41.
# -- FVu, Tue Sep 15 22:52:00 CEST 2009
assert_bash_exec {is_bash_version_minimal 3 2 41 || set +o history}
-}; # start_bash()
+}
# Redirect xtrace output to a file.
@@ -896,7 +1056,7 @@ proc sync_after_tab {} {
# installed, so that "^$cdm.*$" doesn't match too early - before
# comp_install has finished
sleep .4
-}; # sync_after_tab()
+}
# Return current working directory with `TESTDIR' stripped
@@ -905,4 +1065,4 @@ proc wd {} {
global TESTDIR
# Remove `$TESTDIR' prefix from current working directory
set wd [string replace [pwd] 0 [expr [string length $TESTDIR] - 1]]/
-}; # wd()
+}
diff --git a/test/lib/unit.exp b/test/lib/unit.exp
index de870332..e113e1b5 100644
--- a/test/lib/unit.exp
+++ b/test/lib/unit.exp
@@ -1,4 +1,4 @@
-source lib/library.exp
+source $::srcdir/lib/library.exp
proc unit_exit {} {
@@ -7,6 +7,14 @@ proc unit_exit {} {
}
+proc unit_init {test_file_name} {
+ # Call unit_start() only once
+ if {! [info exists ::BASH_VERSINFO]} {
+ unit_start
+ }
+}
+
+
proc unit_start {} {
start_interactive_test
}
diff --git a/test/unit/__expand_tilde_by_ref.exp b/test/unit/__expand_tilde_by_ref.exp
index d4a75d11..abd549cb 100644
--- a/test/unit/__expand_tilde_by_ref.exp
+++ b/test/unit/__expand_tilde_by_ref.exp
@@ -8,14 +8,14 @@ proc setup {home user} {
set _home [string trim $_home]
assert_bash_exec {echo "$USER"} {} /@ _user
set _user [string trim $_user]
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {
/var=/d
}
-}; # teardown()
+}
setup home user
@@ -37,7 +37,7 @@ sync_after_int
set test "~user should return /home/user"
-set cmd [format {var="~%s"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user]
+set cmd [format {var="~%s"; __expand_tilde_by_ref var; printf "%%s\n" "$var"} $user]
assert_bash_list "$home" $cmd $test
@@ -45,7 +45,7 @@ sync_after_int
set test "~/foo should return /home/user/foo"
-set cmd {var='~/foo'; __expand_tilde_by_ref var; printf "%s" "$var"}
+set cmd {var='~/foo'; __expand_tilde_by_ref var; printf "%s\n" "$var"}
assert_bash_list "$home/foo" $cmd $test
@@ -53,7 +53,7 @@ sync_after_int
set test "~user/bar should return /home/user/bar"
-set cmd [format {var="~%s/bar"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user]
+set cmd [format {var="~%s/bar"; __expand_tilde_by_ref var; printf "%%s\n" "$var"} $user]
assert_bash_list "$home/bar" $cmd $test
@@ -61,7 +61,7 @@ sync_after_int
set test "~user/\$HOME should return /home/user/\$HOME"
-set cmd [format {var="~%s/\$HOME"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user]
+set cmd [format {var="~%s/\$HOME"; __expand_tilde_by_ref var; printf "%%s\n" "$var"} $user]
assert_bash_list "$home/\$HOME" $cmd $test
@@ -69,7 +69,7 @@ sync_after_int
set test "'~user/a b' should return '/home/user/a b'"
-set cmd [format {var="~%s/a b"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user]
+set cmd [format {var="~%s/a b"; __expand_tilde_by_ref var; printf "%%s\n" "$var"} $user]
assert_bash_list [list [format {%s/a b} $home]] $cmd $test
@@ -77,7 +77,7 @@ sync_after_int
set test "~user/* should return /home/user/*"
-set cmd [format {var="~%s/*"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user]
+set cmd [format {var="~%s/*"; __expand_tilde_by_ref var; printf "%%s\n" "$var"} $user]
assert_bash_list "$home/\*" $cmd $test
diff --git a/test/unit/_count_args.exp b/test/unit/_count_args.exp
index da61bdb6..b615cab8 100644
--- a/test/unit/_count_args.exp
+++ b/test/unit/_count_args.exp
@@ -1,7 +1,7 @@
proc setup {} {
assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
save_env
-}; # setup()
+}
proc teardown {} {
@@ -12,7 +12,7 @@ proc teardown {} {
d
}
}
-}; # teardown()
+}
setup
@@ -26,7 +26,7 @@ sync_after_int
set test "a b| should set args to 1"; # | = cursor position
-set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _count_args; echo -n $args}
+set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _count_args; echo $args}
assert_bash_list 1 $cmd $test
@@ -34,7 +34,7 @@ sync_after_int
set test "a b|c should set args to 1"; # | = cursor position
-set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _count_args; echo -n $args}
+set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _count_args; echo $args}
assert_bash_list 1 $cmd $test
@@ -42,7 +42,7 @@ sync_after_int
set test "a b c| should set args to 2"; # | = cursor position
-set cmd {COMP_WORDS=(a b c); COMP_CWORD=2; COMP_LINE='a b c'; COMP_POINT=4; _count_args; echo -n $args}
+set cmd {COMP_WORDS=(a b c); COMP_CWORD=2; COMP_LINE='a b c'; COMP_POINT=4; _count_args; echo $args}
assert_bash_list 2 $cmd $test
@@ -50,7 +50,7 @@ sync_after_int
set test "a b| c should set args to 1"; # | = cursor position
-set cmd {COMP_WORDS=(a b c); COMP_CWORD=1; COMP_LINE='a b c'; COMP_POINT=3; _count_args; echo -n $args}
+set cmd {COMP_WORDS=(a b c); COMP_CWORD=1; COMP_LINE='a b c'; COMP_POINT=3; _count_args; echo $args}
assert_bash_list 1 $cmd $test
@@ -58,7 +58,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=2; 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 $args}
assert_bash_list 2 $cmd $test
diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp
index 204d31cf..de494084 100644
--- a/test/unit/_filedir.exp
+++ b/test/unit/_filedir.exp
@@ -20,17 +20,17 @@ proc setup {} {
# directories containing `*' or `\' aren't allowed on Cygwin/Windows
if {! [is_cygwin]} {
# Create directory `a*b'
- assert_bash_exec {(cd fixtures/_filedir && [ ! -d a\*b ] && mkdir a\*b && touch a\*b/j || true)}
+ assert_bash_exec {(cd $TESTDIR/tmp && [ ! -d a\*b ] && mkdir a\*b && touch a\*b/j || true)}
# Create directory `a\b'
- assert_bash_exec {(cd fixtures/_filedir && [ ! -d a\\b ] && mkdir a\\b && touch a\\b/g || true)}
+ assert_bash_exec {(cd $TESTDIR/tmp && [ ! -d a\\b ] && mkdir a\\b && touch a\\b/g || true)}
}
}
proc teardown {} {
if {! [is_cygwin]} {
- assert_bash_exec {(cd fixtures/_filedir && rm -- a\\b/g && rmdir a\\b/ || true)}
- assert_bash_exec {(cd fixtures/_filedir && rm -- a\*b/j && rmdir a\*b/ || true)}
+ assert_bash_exec {(cd $TESTDIR/tmp && rm -- a\\b/g && rmdir a\\b/ || true)}
+ assert_bash_exec {(cd $TESTDIR/tmp && rm -- a\*b/j && rmdir a\*b/ || true)}
}
assert_bash_exec {unset COMPREPLY cur}
assert_bash_exec {unset -f _f _g}
@@ -56,7 +56,7 @@ foreach name {f f2} {
set test "completing $name ab/ should return e"
set cmd "$name ab/"
- assert_complete_dir e $cmd "fixtures/_filedir" $test
+ assert_complete_dir e $cmd "$::srcdir/fixtures/_filedir" $test
sync_after_int
@@ -64,7 +64,7 @@ foreach name {f f2} {
set test "completing $name a\\ b/ should return i"
set cmd "$name a\\ b/"
- assert_complete_dir i $cmd "fixtures/_filedir" $test
+ assert_complete_dir i $cmd "$::srcdir/fixtures/_filedir" $test
sync_after_int
@@ -72,7 +72,7 @@ foreach name {f f2} {
set test "completing $name a\\\'b/ should return c"
set cmd "$name a\\\'b/"
- assert_complete_dir c $cmd "fixtures/_filedir" $test
+ assert_complete_dir c $cmd "$::srcdir/fixtures/_filedir" $test
sync_after_int
@@ -80,7 +80,7 @@ foreach name {f f2} {
set test "completing $name a\\\"b/ should return d"; #"
set cmd "$name a\\\"b/"; #"
- assert_complete_dir d $cmd "fixtures/_filedir" $test
+ assert_complete_dir d $cmd "$::srcdir/fixtures/_filedir" $test
sync_after_int
@@ -88,8 +88,8 @@ foreach name {f f2} {
set test "completing $name a\\\$b/ should return h"
set cmd "$name a\\\$b/"
- assert_complete_dir "\b\b\b\b\b$::TESTDIR/fixtures/_filedir/a\\\\\$b/h" \
- $cmd "fixtures/_filedir" $test
+ assert_complete_dir "\b\b\b\b\b$::srcdirabs/fixtures/_filedir/a\\\\\$b/h" \
+ $cmd "$::srcdir/fixtures/_filedir" $test
sync_after_int
@@ -101,7 +101,7 @@ foreach name {f f2} {
if {! [is_cygwin]} {
set test "completing $name a\\\\b/ should return g"
set cmd "$name a\\\\b/"
- assert_complete_dir g $cmd "fixtures/_filedir" $test
+ assert_complete_dir g $cmd "$TESTDIR/tmp" $test
sync_after_int
@@ -110,7 +110,7 @@ foreach name {f f2} {
set test "completing $name a\\&b/ should return f"
set cmd "$name a\\&b/"
- assert_complete_dir f $cmd "fixtures/_filedir" $test
+ assert_complete_dir f $cmd "$::srcdir/fixtures/_filedir" $test
sync_after_int
@@ -118,7 +118,7 @@ foreach name {f f2} {
set test "completing $name a\$ should return a\\\$b/"
set cmd "$name a\$"
- assert_complete_dir "\b\\\\\$b/" $cmd "fixtures/_filedir" $test
+ assert_complete_dir "\b\\\\\$b/" $cmd "$::srcdir/fixtures/_filedir" $test -nospace
sync_after_int
@@ -132,21 +132,21 @@ foreach name {f f2} {
[lindex $::BASH_VERSINFO 2] < 35
)} {
set cmd "$name 'ab/"
- assert_complete_dir {e'} $cmd "fixtures/_filedir"
+ assert_complete_dir {e'} $cmd "$::srcdir/fixtures/_filedir"
sync_after_int
set cmd "$name 'a b/"
- assert_complete_dir {i'} $cmd "fixtures/_filedir"
+ assert_complete_dir {i'} $cmd "$::srcdir/fixtures/_filedir"
sync_after_int
set cmd "$name 'a\"b/"; #"
- assert_complete_dir {d'} $cmd "fixtures/_filedir"
+ assert_complete_dir {d'} $cmd "$::srcdir/fixtures/_filedir"
sync_after_int
@@ -154,9 +154,9 @@ foreach name {f f2} {
set cmd "$name 'a\$b/"
if {[lindex $::BASH_VERSINFO 0] == 4} {
- assert_complete_dir {h'} $cmd "fixtures/_filedir"
+ assert_complete_dir {h'} $cmd "$::srcdir/fixtures/_filedir"
} else {
- assert_complete_dir "\b\b\b\b$::TESTDIR/fixtures/_filedir/a\$b/h'" $cmd "fixtures/_filedir"
+ assert_complete_dir "\b\b\b\b$::srcdirabs/fixtures/_filedir/a\$b/h'" $cmd "$::srcdir/fixtures/_filedir"
}
@@ -166,8 +166,8 @@ foreach name {f f2} {
# Execute these tests only when not running on Cygwin/Windows, because
# directories containing `*' or `\' aren't allowed on Cygwin/Windows
if {! [is_cygwin]} {
- set cmd "$name 'a\\b/"
- assert_complete_dir {g'} $cmd "fixtures/_filedir"
+ set cmd "$name '$TESTDIR/tmp/a\\b/"
+ assert_complete_dir {g'} $cmd "$TESTDIR/tmp"
sync_after_int
@@ -175,63 +175,63 @@ foreach name {f f2} {
set cmd "$name 'a&b/"
- assert_complete_dir {f'} $cmd "fixtures/_filedir"
+ assert_complete_dir {f'} $cmd "$::srcdir/fixtures/_filedir"
sync_after_int
set cmd "$name \"ab/"; #"
- assert_complete_dir {e"} $cmd "fixtures/_filedir"; #"
+ assert_complete_dir {e"} $cmd "$::srcdir/fixtures/_filedir"; #"
sync_after_int
set cmd "$name \"a b/"; #"
- assert_complete_dir {i"} $cmd "fixtures/_filedir"; #"
+ assert_complete_dir {i"} $cmd "$::srcdir/fixtures/_filedir"; #"
sync_after_int
set cmd "$name \"a'b/"; #"
- assert_complete_dir {c"} $cmd "fixtures/_filedir"; #"
+ assert_complete_dir {c"} $cmd "$::srcdir/fixtures/_filedir"; #"
sync_after_int
set cmd "$name \"a\\\"b/"; #"
- assert_complete_dir {d"} $cmd "fixtures/_filedir"; #"
+ assert_complete_dir {d"} $cmd "$::srcdir/fixtures/_filedir"; #"
sync_after_int
set cmd "$name \"a\\\$b/"; #"
- assert_complete_dir "\b\b\b\b\b$::TESTDIR/fixtures/_filedir/a\\\\\$b/h\\\"" $cmd "fixtures/_filedir"
+ assert_complete_dir "\b\b\b\b\b$::srcdirabs/fixtures/_filedir/a\\\\\$b/h\\\"" $cmd "$::srcdir/fixtures/_filedir"
sync_after_int
set cmd "$name \"a\\b/"; #"
- assert_complete_dir "\b\b\bb/e\\\"" $cmd "fixtures/_filedir"
+ assert_complete_dir "\b\b\bb/e\\\"" $cmd "$::srcdir/fixtures/_filedir"
sync_after_int
set cmd "$name \"a\\\\b/"; #"
- assert_complete_dir {g"} $cmd "fixtures/_filedir"; #"
+ assert_complete_dir {g"} $cmd "$TESTDIR/tmp"; #"
sync_after_int
set cmd "$name \"a&b/"; #"
- assert_complete_dir {f"} $cmd "fixtures/_filedir"; #"
+ assert_complete_dir {f"} $cmd "$::srcdir/fixtures/_filedir"; #"
sync_after_int
@@ -242,23 +242,27 @@ foreach name {f f2} {
set test "completing with filter '.e1' should show completions"
-assert_complete_dir {ee.e1 foo/ gg.e1} "g " "fixtures/_filedir/ext" $test
+assert_complete_dir {ee.e1 foo/ gg.e1 ii.E1} "g " "$::srcdir/fixtures/_filedir/ext" $test
sync_after_int
-set test "completing f aé should return g when LC_CTYPE=C"
-# Backup/set LC_CTYPE
-assert_bash_exec {OLD_CTYPE=$LC_CTYPE; LC_CTYPE=C}
-if {[lindex $::BASH_VERSINFO 0] > 3} {
- assert_complete_dir g "f aé/" "fixtures/_filedir"
+set test "completing f aé should return g"
+# Execute this test only on bash >= 4 with LC_CTYPE matching *UTF-8*
+# See also: http://www.mail-archive.com/bash-completion-devel\
+# @lists.alioth.debian.org/msg02265.html
+# Don't execute this test on expect-5.44 cause it will segfault
+# See also: Alioth #312792
+if {
+ [lindex $::BASH_VERSINFO 0] >= 4 &&
+ [string first "UTF-8" $::LC_CTYPE] != -1 &&
+ [string first 5.44 [exp_version]] != 0
+} {
+ assert_complete_dir g "f aé/" "$::srcdir/fixtures/_filedir"
} else {
- assert_complete_dir "\b\b\b\b$'a\\\\303\\\\251/g'" "f aé/" \
- "fixtures/_filedir"
+ unsupported "$test"
}
-# Restore LC_CTYPE
-assert_bash_exec {[[ $OLD_CTYPE ]] && LC_CTYPE=$OLD_CTYPE || unset LC_CTYPE}
sync_after_int
diff --git a/test/unit/_get_comp_words_by_ref.exp b/test/unit/_get_comp_words_by_ref.exp
index 22561e7f..2ddcef23 100644
--- a/test/unit/_get_comp_words_by_ref.exp
+++ b/test/unit/_get_comp_words_by_ref.exp
@@ -1,7 +1,7 @@
proc setup {} {
assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
save_env
-}; # setup()
+}
proc teardown {} {
@@ -15,7 +15,7 @@ proc teardown {} {
d
}
}
-}; # teardown()
+}
setup
@@ -105,7 +105,7 @@ if {
set cmd {COMP_WORDS=(a "'" b c); COMP_CWORD=3}
} else {
set cmd {COMP_WORDS=(a "'b c"); COMP_CWORD=1}
-}; # if
+}
append cmd {; COMP_LINE="a 'b c"; COMP_POINT=6; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
send "$cmd\r"
expect -ex "$cmd\r\n"
@@ -118,7 +118,7 @@ expect {
[lindex $::BASH_VERSINFO 2] < 35
} {xfail "$test"} {fail "$test"}
}
-}; # expect
+}
sync_after_int
@@ -133,7 +133,7 @@ if {
set cmd {COMP_WORDS=(a "\"" b c); COMP_CWORD=3}
} else {
set cmd {COMP_WORDS=(a "\"b c"); COMP_CWORD=1}
-}; # if
+}
append cmd {; COMP_LINE="a \"b c"; COMP_POINT=6}
assert_bash_exec $cmd
set cmd {_get_comp_words_by_ref cur prev; echo "$cur $prev"};
@@ -148,7 +148,7 @@ expect {
[lindex $::BASH_VERSINFO 2] < 35
} {xfail "$test"} {fail "$test"}
}
-}; # expect
+}
sync_after_int
@@ -161,7 +161,7 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
} else {
set cmd {add_comp_wordbreak_char :; COMP_WORDS=(a b : c); COMP_CWORD=3}
set expected {"c :"}
-}; # if
+}
append cmd {; COMP_LINE='a b:c'; COMP_POINT=5}
# NOTE: Split-send cmd to prevent backspaces (\008) in output
assert_bash_exec $cmd $test
@@ -177,7 +177,7 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
set cmd {COMP_WORDS=(a "b:c"); COMP_CWORD=1}
} else {
set cmd {COMP_WORDS=(a b : c); COMP_CWORD=3}
-}; # if
+}
append cmd {; COMP_LINE='a b:c'; COMP_POINT=5}
assert_bash_exec $cmd $test
set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"}
@@ -192,7 +192,7 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
set cmd {COMP_WORDS=(a b c:); COMP_CWORD=2}
} else {
set cmd {COMP_WORDS=(a b c :); COMP_CWORD=3}
-}; # if
+}
append cmd {; COMP_LINE='a b c:'; COMP_POINT=6}
assert_bash_exec $cmd $test
set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"}
@@ -202,6 +202,21 @@ assert_bash_list {"c: b"} $cmd $test
sync_after_int
+set test {a b:c | with WORDBREAKS -= :}; # | = cursor position
+if {[lindex $::BASH_VERSINFO 0] <= 3} {
+ set cmd {COMP_WORDS=(a b:c ''); COMP_CWORD=2}
+} else {
+ set cmd {COMP_WORDS=(a b : c ''); COMP_CWORD=4}
+}
+append cmd {; COMP_LINE='a b:c '; COMP_POINT=6}
+assert_bash_exec $cmd $test
+set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"}
+assert_bash_list {" b:c"} $cmd $test
+
+
+sync_after_int
+
+
set test {a :| with WORDBREAKS -= : should return :}; # | = cursor position
set cmd {COMP_WORDS=(a :); COMP_CWORD=1; COMP_LINE='a :'; COMP_POINT=3}
assert_bash_exec $cmd
@@ -217,7 +232,7 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
set cmd {COMP_WORDS=(a "b::"); COMP_CWORD=1}
} else {
set cmd {COMP_WORDS=(a b ::); COMP_CWORD=2}
-}; # if
+}
append cmd {; COMP_LINE='a b::'; COMP_POINT=5}
assert_bash_exec $cmd
set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"}
@@ -232,7 +247,7 @@ sync_after_int
set test "a -n| should return -n"; # | = cursor position
set cmd {COMP_WORDS=(a -n); COMP_CWORD=1; COMP_LINE='a -n'; COMP_POINT=4}
assert_bash_exec $cmd
-set cmd {_get_comp_words_by_ref cur; printf %s $cur}
+set cmd {_get_comp_words_by_ref cur; printf "%s\n" $cur}
assert_bash_list -n $cmd $test
@@ -256,7 +271,7 @@ if {[lindex $::BASH_VERSINFO] <= 3} {
} else {
set cmd {COMP_WORDS=(a b = c); COMP_CWORD=3}
set expected c
-}; # if
+}
append cmd {; COMP_LINE='a b=c'; COMP_POINT=5}
assert_bash_exec $cmd
set cmd {_get_comp_words_by_ref cur prev; echo "$cur"}
@@ -286,7 +301,7 @@ expect {
-ex "\$(b c/@" { pass "$test" }
# Expected failure on bash-4
-ex "c/@" { xfail "$test" }
-}; # expect
+}
sync_after_int
@@ -303,7 +318,7 @@ expect {
-ex "\$(b c\\ d/@" { pass "$test" }
# Expected failure on bash-4
-ex "c\\ d/@" { xfail "$test" }
-}; # expect
+}
sync_after_int
@@ -318,7 +333,7 @@ if {
set cmd {COMP_WORDS=(a "'" b "&" c); COMP_CWORD=4}
} else {
set cmd {COMP_WORDS=(a "'b&c"); COMP_CWORD=1}
-}; # if
+}
append cmd {; COMP_LINE="a 'b&c"; COMP_POINT=6}
assert_bash_exec $cmd
set cmd {_get_comp_words_by_ref cur prev; printf %s "$cur"}
@@ -333,7 +348,7 @@ expect {
[lindex $::BASH_VERSINFO 2] < 35
} {xfail "$test"} {fail "$test"}
}
-}; # expect
+}
sync_after_int
diff --git a/test/unit/_get_cword.exp b/test/unit/_get_cword.exp
index 1e6e9bfb..ce749cec 100644
--- a/test/unit/_get_cword.exp
+++ b/test/unit/_get_cword.exp
@@ -1,7 +1,7 @@
proc setup {} {
assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
save_env
-}; # setup()
+}
proc teardown {} {
@@ -12,7 +12,7 @@ proc teardown {} {
d
}
}
-}; # teardown()
+}
setup
@@ -30,7 +30,7 @@ sync_after_int
set test "a b| should return b"; # | = cursor position
-set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _get_cword}
+set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _get_cword; echo}
assert_bash_list b $cmd $test
@@ -65,7 +65,7 @@ sync_after_int
set test "a b|c should return b"; # | = cursor position
-set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _get_cword}
+set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _get_cword; echo}
assert_bash_list b $cmd $test
@@ -73,7 +73,7 @@ sync_after_int
set test {a b\ c| should return b\ c}; # | = cursor position
-set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=6; _get_cword}
+set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=6; _get_cword; echo}
assert_bash_list {"b\\ c"} $cmd $test
@@ -81,7 +81,7 @@ sync_after_int
set test {a b\| c should return b\ }; # | = cursor position
-set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=4; _get_cword}
+set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=4; _get_cword; echo}
assert_bash_list {"b\\"} $cmd $test
@@ -89,7 +89,7 @@ sync_after_int
set test {a "b\| should return "b\ }; # | = cursor position
-set cmd {COMP_WORDS=(a '"b\'); COMP_CWORD=1; COMP_LINE='a "b\'; COMP_POINT=5; _get_cword}
+set cmd {COMP_WORDS=(a '"b\'); COMP_CWORD=1; COMP_LINE='a "b\'; COMP_POINT=5; _get_cword; echo}
assert_bash_list {"\"b\\"} $cmd $test
@@ -105,7 +105,7 @@ if {
set cmd {COMP_WORDS=(a "'" b c); COMP_CWORD=3}
} else {
set cmd {COMP_WORDS=(a "'b c"); COMP_CWORD=1}
-}; # if
+}
append cmd {; COMP_LINE="a 'b c"; COMP_POINT=6; _get_cword}
send "$cmd\r"
expect -ex "$cmd\r\n"
@@ -118,7 +118,7 @@ expect {
[lindex $::BASH_VERSINFO 2] < 35
} {xfail "$test"} {fail "$test"}
}
-}; # expect
+}
sync_after_int
@@ -133,7 +133,7 @@ if {
set cmd {COMP_WORDS=(a "\"" b c); COMP_CWORD=3}
} else {
set cmd {COMP_WORDS=(a "\"b c"); COMP_CWORD=1}
-}; # if
+}
append cmd {; COMP_LINE="a \"b c"; COMP_POINT=6; _get_cword};
send "$cmd\r"
expect -ex "$cmd\r\n"
@@ -146,7 +146,7 @@ expect {
[lindex $::BASH_VERSINFO 2] < 35
} {xfail "$test"} {fail "$test"}
}
-}; # expect
+}
sync_after_int
@@ -159,8 +159,8 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
} else {
set cmd {add_comp_wordbreak_char :; COMP_WORDS=(a b : c); COMP_CWORD=3}
set expected c
-}; # if
-append cmd {; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword}
+}
+append cmd {; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword; echo}
assert_bash_list $expected $cmd $test
@@ -172,8 +172,8 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
set cmd {COMP_WORDS=(a "b:c"); COMP_CWORD=1}
} else {
set cmd {COMP_WORDS=(a b : c); COMP_CWORD=3}
-}; # if
-append cmd {; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword :}
+}
+append cmd {; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword :; echo}
assert_bash_list b:c $cmd $test
@@ -185,8 +185,8 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
set cmd {COMP_WORDS=(a b c:); COMP_CWORD=2}
} else {
set cmd {COMP_WORDS=(a b c :); COMP_CWORD=3}
-}; # if
-append cmd {; COMP_LINE='a b c:'; COMP_POINT=6; _get_cword :}
+}
+append cmd {; COMP_LINE='a b c:'; COMP_POINT=6; _get_cword :; echo}
assert_bash_list c: $cmd $test
@@ -194,7 +194,7 @@ sync_after_int
set test {a :| with WORDBREAKS -= : should return :}; # | = cursor position
-set cmd {COMP_WORDS=(a :); COMP_CWORD=1; COMP_LINE='a :'; COMP_POINT=3; _get_cword :}
+set cmd {COMP_WORDS=(a :); COMP_CWORD=1; COMP_LINE='a :'; COMP_POINT=3; _get_cword :; echo}
assert_bash_list : $cmd $test
@@ -206,8 +206,8 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
set cmd {COMP_WORDS=(a "b::"); COMP_CWORD=1}
} else {
set cmd {COMP_WORDS=(a b ::); COMP_CWORD=2}
-}; # if
-append cmd {; COMP_LINE='a b::'; COMP_POINT=5; _get_cword :}
+}
+append cmd {; COMP_LINE='a b::'; COMP_POINT=5; _get_cword :; echo}
assert_bash_list b:: $cmd $test
@@ -217,7 +217,7 @@ sync_after_int
# This test makes sure `_get_cword' doesn't use `echo' to return it's value,
# because -n might be interpreted by `echo' and thus will not be returned.
set test "a -n| should return -n"; # | = cursor position
-set cmd {COMP_WORDS=(a -n); COMP_CWORD=1; COMP_LINE='a -n'; COMP_POINT=4; _get_cword}
+set cmd {COMP_WORDS=(a -n); COMP_CWORD=1; COMP_LINE='a -n'; COMP_POINT=4; _get_cword; echo}
assert_bash_list -n $cmd $test
@@ -225,7 +225,7 @@ sync_after_int
set test {a b>c| should return c}; # | = cursor position
-set cmd {COMP_WORDS=(a b \> c); COMP_CWORD=3; COMP_LINE='a b>c'; COMP_POINT=5; _get_cword}
+set cmd {COMP_WORDS=(a b \> c); COMP_CWORD=3; COMP_LINE='a b>c'; COMP_POINT=5; _get_cword; echo}
assert_bash_list c $cmd $test
@@ -239,8 +239,8 @@ if {[lindex $::BASH_VERSINFO] <= 3} {
} else {
set cmd {COMP_WORDS=(a b = c); COMP_CWORD=3}
set expected c
-}; # if
-append cmd {; COMP_LINE='a b=c'; COMP_POINT=5; _get_cword}
+}
+append cmd {; COMP_LINE='a b=c'; COMP_POINT=5; _get_cword; echo}
assert_bash_list $expected $cmd $test
@@ -248,7 +248,7 @@ sync_after_int
set test {a *| should return *}; # | = cursor position
-set cmd {COMP_WORDS=(a \*); COMP_CWORD=1; COMP_LINE='a *'; COMP_POINT=4; _get_cword}
+set cmd {COMP_WORDS=(a \*); COMP_CWORD=1; COMP_LINE='a *'; COMP_POINT=4; _get_cword; echo}
assert_bash_list * $cmd $test
@@ -264,7 +264,7 @@ expect {
-ex "\$(b c/@" { pass "$test" }
# Expected failure on bash-4
-ex "c/@" { xfail "$test" }
-}; # expect
+}
sync_after_int
@@ -279,7 +279,7 @@ expect {
-ex "\$(b c\\ d/@" { pass "$test" }
# Expected failure on bash-4
-ex "c\\ d/@" { xfail "$test" }
-}; # expect
+}
sync_after_int
@@ -294,7 +294,7 @@ if {
set cmd {COMP_WORDS=(a "'" b "&" c); COMP_CWORD=4}
} else {
set cmd {COMP_WORDS=(a "'b&c"); COMP_CWORD=1}
-}; # if
+}
append cmd {; COMP_LINE="a 'b&c"; COMP_POINT=6; _get_cword}
send "$cmd\r"
expect -ex "$cmd\r\n"
@@ -307,7 +307,7 @@ expect {
[lindex $::BASH_VERSINFO 2] < 35
} {xfail "$test"} {fail "$test"}
}
-}; # expect
+}
sync_after_int
diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp
index 152cf885..604b2d5e 100644
--- a/test/unit/_known_hosts_real.exp
+++ b/test/unit/_known_hosts_real.exp
@@ -1,6 +1,9 @@
proc setup {} {
+ # NOTE: Changing dir to $SRCDIR is necessary because file locations in the
+ # ssh config files (e.g. UserKnownHostsFile) are relative to $SRCDIR.
+ assert_bash_exec {cd $SRCDIR}
save_env
-}; # setup()
+}
proc teardown {} {
@@ -8,7 +11,8 @@ proc teardown {} {
/COMPREPLY=/d
/OLDHOME=/d
}
-}; # teardown()
+ assert_bash_exec {cd $TESTDIR}
+}
setup
@@ -17,10 +21,10 @@ setup
set test "Hosts should be put in COMPREPLY"
set hosts [get_hosts]
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
- # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts
-lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2
+ # doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 test cases in ./fixtures/_known_hosts_real/known_hosts
+lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42
set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY}
-assert_bash_list $hosts $cmd $test
+assert_bash_list $hosts $cmd $test -sort
sync_after_int
@@ -29,16 +33,16 @@ sync_after_int
set test "Hosts should have username prefix and colon suffix"
set hosts [get_hosts]
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
- # doo, ike jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts
-lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2
+ # doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 test cases in ./fixtures/_known_hosts_real/known_hosts
+lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42
set hosts [lsort -ascii $hosts]
set expected {}
foreach host $hosts {
lappend expected "user@$host:"
-}; # foreach
+}
# Call _known_hosts
set cmd {unset COMPREPLY; _known_hosts_real -acF fixtures/_known_hosts_real/config 'user@'; echo_array COMPREPLY}
-assert_bash_list $expected $cmd $test
+assert_bash_list $expected $cmd $test -sort
sync_after_int
@@ -66,7 +70,7 @@ expect {
-re "^$hosts_config\r\n/@$" { fail "$test (known hosts file)" }
-re /@ { unresolved "$test at prompt" }
default { unresolved "$test" }
-}; # expect
+}
sync_after_int
@@ -79,7 +83,7 @@ set hosts [get_hosts]
lappend hosts two three
set hosts [join [bash_sort $hosts] "\\s+"]
# Setup environment
-set cmd {OLDHOME=$HOME; HOME=$TESTDIR}
+set cmd {OLDHOME=$HOME; HOME=$SRCDIRABS}
send "$cmd\r"
expect -ex "$cmd\r\n/@"
# Call _known_hosts
@@ -89,7 +93,7 @@ expect -ex "$cmd\r\n"
expect {
-re "^$hosts\r\n/@$" { pass "$test" }
default { unresolved "$test" }
-}; # expect
+}
# Teardown environment
set cmd {HOME=$OLDHOME}
send "$cmd\r"
@@ -103,11 +107,11 @@ set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE"
assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE="
set hosts [get_hosts_avahi]
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
- # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts
-lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2
+ # doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 test cases in ./fixtures/_known_hosts_real/known_hosts
+lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42
# Call _known_hosts
set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY}
-assert_bash_list $hosts $cmd $test
+assert_bash_list $hosts $cmd $test -sort
sync_after_int
assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE"
diff --git a/test/unit/_parse_help.exp b/test/unit/_parse_help.exp
new file mode 100644
index 00000000..4beb28d2
--- /dev/null
+++ b/test/unit/_parse_help.exp
@@ -0,0 +1,73 @@
+# By Stephen Gildea, October 2010.
+
+proc setup {} {
+ save_env
+}
+
+proc teardown {} {
+ assert_env_unmodified {
+ /declare -f fn/d
+ }
+}
+
+setup
+
+
+set cmd {fn() { printf '%s\n' ""; }; _parse_help fn}
+assert_bash_list "" $cmd "empty"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "no dashes here"; }; _parse_help fn}
+assert_bash_list "" $cmd "no dashes"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "internal-dash"; }; _parse_help fn}
+assert_bash_list "" $cmd "internal dash 1"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "no -leading-dashes"; }; _parse_help fn}
+assert_bash_list "" $cmd "no leading dash"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "-one dash"; }; _parse_help fn}
+assert_bash_list "-one" $cmd "one dash"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' " -space dash"; }; _parse_help fn}
+assert_bash_list "-space" $cmd "one dash after space"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "-one -two dashes"; }; _parse_help fn}
+assert_bash_list "-one\n-two" $cmd "two dashes, space-separated"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "-one,-t dashes"; }; _parse_help fn}
+assert_bash_list "-one\n-t" $cmd "two dashes, comma-separated"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "-one dash-inside"; }; _parse_help fn}
+assert_bash_list "-one" $cmd "internal dash 2"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "--long-arg=value"; }; _parse_help fn}
+assert_bash_list "--long-arg" $cmd "value stripped"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "--long-arg=-value"; }; _parse_help fn}
+assert_bash_list "--long-arg" $cmd "value not seen as option"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "--long-arg=-value,--opt2=val"; }; _parse_help fn}
+assert_bash_list "--long-arg\n--opt2" $cmd "two options with values"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "-m,--mirror"; }; _parse_help fn}
+assert_bash_list "-m\n--mirror" $cmd "short + long"
+sync_after_int
+
+set cmd {fn() { printf '%s\n' "-T/--upload-file"; }; _parse_help fn}
+assert_bash_list "-T\n--upload-file" $cmd "short + long, slash separated"
+sync_after_int
+
+
+teardown
diff --git a/test/unit/_tilde.exp b/test/unit/_tilde.exp
new file mode 100644
index 00000000..2e22b848
--- /dev/null
+++ b/test/unit/_tilde.exp
@@ -0,0 +1,51 @@
+# @param string $part Reference to variable to hold partial unique username
+# @param string $full Reference to variable to hold full unique username
+proc setup {part full} {
+ upvar $part _part
+ upvar $full _full
+
+ assert_bash_exec {compgen -u} {} /@ users
+ find_unique_completion_pair $users _part _full
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified {
+ /COMPREPLY=/d
+ }
+}
+
+
+setup part full
+
+
+set test "function should run without errors"
+assert_bash_exec {_tilde > /dev/null} $test
+
+
+sync_after_int
+
+
+set test "function should not pollute environment"
+# NOTE: A possible environment pollution is detected by assert_env_modified() in teardown()
+assert_bash_exec {foo() { local aa="~"; _tilde "$aa"; }; foo; unset foo} $test
+
+
+sync_after_int
+
+
+set test "~full should complete to ~full unmodified"
+set cmd [format {_tilde "~%s"; printf "%%s\n" "${COMPREPLY[@]}"} $full]
+assert_bash_list "~$full" $cmd $test
+
+
+sync_after_int
+
+
+set test "~part should complete to ~full"
+set cmd [format {_tilde "~%s"; printf "%%s\n" "${COMPREPLY[@]}"} $part]
+assert_bash_list "~$full" $cmd $test
+
+
+teardown
diff --git a/test/unit/compgen.exp b/test/unit/compgen.exp
index 6673bf0e..6e6f79c6 100644
--- a/test/unit/compgen.exp
+++ b/test/unit/compgen.exp
@@ -1,11 +1,11 @@
proc setup {} {
save_env
-}; # setup()
+}
proc teardown {} {
assert_env_unmodified {/OLDPWD/d}
-}; # teardown()
+}
setup
@@ -17,10 +17,9 @@ if {[lindex $::BASH_VERSINFO 0] <= 3} {
} else {
set test {compgen -f a\\\'b/ on bash-4 should return a\'b/c};
set cmd {compgen -f a\\\'b/}
-}; # if
-set dir fixtures/compgen
-set prompt "/$dir/@"
-assert_bash_exec "cd $dir" "" $prompt
+}
+set dir $::srcdir/fixtures/compgen
+assert_bash_exec "cd $dir"
send "$cmd\r"
expect -ex "$cmd\r\n"
expect {
@@ -37,13 +36,13 @@ expect {
if {[lindex $::BASH_VERSINFO 0] <= 3 } \
{pass $test} else {fail $test}
}
- -re $prompt { pass "$test" }
+ -re /@ { pass "$test" }
-re eof { unresolved "eof" }
-}; # expect
-sync_after_int $prompt
+}
+sync_after_int
assert_bash_exec {cd "$TESTDIR"}
-#assert_bash_list_dir {a\\\'b/c} $cmd fixtures/compgen
+#assert_bash_list_dir {a\\\'b/c} $cmd $::srcdir/fixtures/compgen
sync_after_int