summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Paleino <dapal@debian.org>2010-06-16 18:20:29 +0200
committerDavid Paleino <dapal@debian.org>2010-06-16 18:20:29 +0200
commitf9748115fb4b2950fb4df7535fb723c4affde078 (patch)
tree20875f42b219a5d56e8a7e98840f6dbced003ae0 /test
parente5a9b6220e93ca656fd9774c6aefa78241edca6f (diff)
downloadbash-completion-f9748115fb4b2950fb4df7535fb723c4affde078.tar.gz
Imported Upstream version 1.2upstream/1.2
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am8
-rw-r--r--test/Makefile.in343
-rw-r--r--test/completion/a2ps.exp1
-rw-r--r--test/completion/abook.exp1
-rw-r--r--test/completion/acroread.exp12
-rw-r--r--test/completion/add_members.exp1
-rw-r--r--test/completion/alias.exp1
-rw-r--r--test/completion/animate.exp1
-rw-r--r--test/completion/ant.exp1
-rw-r--r--test/completion/apache2ctl.exp1
-rw-r--r--test/completion/apt-build.exp1
-rw-r--r--test/completion/apt-cache.exp1
-rw-r--r--test/completion/apt-get.exp1
-rw-r--r--test/completion/aptitude.exp1
-rw-r--r--test/completion/arch.exp1
-rw-r--r--test/completion/arpspoof.exp1
-rw-r--r--test/completion/aspell.exp1
-rw-r--r--test/completion/autoconf.exp1
-rw-r--r--test/completion/automake.exp1
-rw-r--r--test/completion/autorpm.exp1
-rw-r--r--test/completion/awk.exp1
-rw-r--r--test/completion/bash.exp1
-rw-r--r--test/completion/bc.exp1
-rw-r--r--test/completion/bison.exp1
-rw-r--r--test/completion/bk.exp1
-rw-r--r--test/completion/brctl.exp1
-rw-r--r--test/completion/btdownloadcurses.py.exp1
-rw-r--r--test/completion/btdownloadgui.py.exp1
-rw-r--r--test/completion/btdownloadheadless.py.exp1
-rw-r--r--test/completion/bzip2.exp1
-rw-r--r--test/completion/c++.exp1
-rw-r--r--test/completion/cancel.exp1
-rw-r--r--test/completion/cardctl.exp1
-rw-r--r--test/completion/cat.exp1
-rw-r--r--test/completion/cc.exp1
-rw-r--r--test/completion/cd.exp1
-rw-r--r--test/completion/cdrecord.exp1
-rw-r--r--test/completion/change_pw.exp1
-rw-r--r--test/completion/check_db.exp1
-rw-r--r--test/completion/check_perms.exp1
-rw-r--r--test/completion/chgrp.exp1
-rw-r--r--test/completion/chkconfig.exp1
-rw-r--r--test/completion/chown.exp1
-rw-r--r--test/completion/chsh.exp1
-rw-r--r--test/completion/ci.exp1
-rw-r--r--test/completion/civclient.exp1
-rw-r--r--test/completion/civserver.exp1
-rw-r--r--test/completion/cksfv.exp1
-rw-r--r--test/completion/cleanarch.exp1
-rw-r--r--test/completion/clisp.exp1
-rw-r--r--test/completion/clone_member.exp1
-rw-r--r--test/completion/co.exp1
-rw-r--r--test/completion/composite.exp1
-rw-r--r--test/completion/config_list.exp1
-rw-r--r--test/completion/configure.exp1
-rw-r--r--test/completion/convert.exp1
-rw-r--r--test/completion/cowsay.exp1
-rw-r--r--test/completion/cp.exp1
-rw-r--r--test/completion/cpio.exp1
-rw-r--r--test/completion/createdb.exp1
-rw-r--r--test/completion/cryptsetup.exp1
-rw-r--r--test/completion/csplit.exp1
-rw-r--r--test/completion/cut.exp1
-rw-r--r--test/completion/cvs.exp1
-rw-r--r--test/completion/cvsps.exp1
-rw-r--r--test/completion/date.exp1
-rw-r--r--test/completion/dcop.exp1
-rw-r--r--test/completion/dd.exp1
-rw-r--r--test/completion/df.exp1
-rw-r--r--test/completion/dhclient.exp1
-rw-r--r--test/completion/dict.exp1
-rw-r--r--test/completion/diff.exp1
-rw-r--r--test/completion/dir.exp1
-rw-r--r--test/completion/display.exp1
-rw-r--r--test/completion/dnsspoof.exp1
-rw-r--r--test/completion/dpkg-deb.exp1
-rw-r--r--test/completion/dpkg-reconfigure.exp1
-rw-r--r--test/completion/dpkg-source.exp1
-rw-r--r--test/completion/dpkg.exp1
-rw-r--r--test/completion/dropdb.exp1
-rw-r--r--test/completion/dselect.exp1
-rw-r--r--test/completion/dsniff.exp1
-rw-r--r--test/completion/du.exp1
-rw-r--r--test/completion/dumpdb.exp1
-rw-r--r--test/completion/enscript.exp1
-rw-r--r--test/completion/env.exp1
-rw-r--r--test/completion/evince.exp1
-rw-r--r--test/completion/expand.exp1
-rw-r--r--test/completion/filesnarf.exp1
-rw-r--r--test/completion/find.exp1
-rw-r--r--test/completion/find_member.exp1
-rw-r--r--test/completion/finger.exp6
-rw-r--r--test/completion/fmt.exp1
-rw-r--r--test/completion/fold.exp1
-rw-r--r--test/completion/g++.exp1
-rw-r--r--test/completion/g4.exp1
-rw-r--r--test/completion/g77.exp1
-rw-r--r--test/completion/gcc.exp1
-rw-r--r--test/completion/gcj.exp1
-rw-r--r--test/completion/gcl.exp1
-rw-r--r--test/completion/gdb.exp1
-rw-r--r--test/completion/genaliases.exp1
-rw-r--r--test/completion/getent.exp1
-rw-r--r--test/completion/gkrellm.exp1
-rw-r--r--test/completion/gmplayer.exp1
-rw-r--r--test/completion/gnatmake.exp1
-rw-r--r--test/completion/gpc.exp1
-rw-r--r--test/completion/gperf.exp1
-rw-r--r--test/completion/gpg.exp1
-rw-r--r--test/completion/gprof.exp1
-rw-r--r--test/completion/grep.exp1
-rw-r--r--test/completion/grub.exp1
-rw-r--r--test/completion/gzip.exp1
-rw-r--r--test/completion/hcitool.exp1
-rw-r--r--test/completion/head.exp1
-rw-r--r--test/completion/iconv.exp1
-rw-r--r--test/completion/id.exp1
-rw-r--r--test/completion/identify.exp1
-rw-r--r--test/completion/ifdown.exp1
-rw-r--r--test/completion/ifup.exp1
-rw-r--r--test/completion/indent.exp1
-rw-r--r--test/completion/info.exp1
-rw-r--r--test/completion/inject.exp1
-rw-r--r--test/completion/insmod.exp1
-rw-r--r--test/completion/invoke-rc.d.exp1
-rw-r--r--test/completion/ipsec.exp1
-rw-r--r--test/completion/ipv6calc.exp1
-rw-r--r--test/completion/irb.exp1
-rw-r--r--test/completion/isql.exp1
-rw-r--r--test/completion/iwconfig.exp1
-rw-r--r--test/completion/iwlist.exp1
-rw-r--r--test/completion/iwpriv.exp1
-rw-r--r--test/completion/iwspy.exp1
-rw-r--r--test/completion/jar.exp1
-rw-r--r--test/completion/jarsigner.exp1
-rw-r--r--test/completion/java.exp1
-rw-r--r--test/completion/javac.exp1
-rw-r--r--test/completion/javadoc.exp1
-rw-r--r--test/completion/k3b.exp1
-rw-r--r--test/completion/kdvi.exp1
-rw-r--r--test/completion/kill.exp1
-rw-r--r--test/completion/killall.exp1
-rw-r--r--test/completion/kldload.exp1
-rw-r--r--test/completion/kldunload.exp1
-rw-r--r--test/completion/kpdf.exp1
-rw-r--r--test/completion/kplayer.exp1
-rw-r--r--test/completion/larch.exp1
-rw-r--r--test/completion/ld.exp1
-rw-r--r--test/completion/ldd.exp1
-rw-r--r--test/completion/less.exp1
-rw-r--r--test/completion/lftp.exp1
-rw-r--r--test/completion/lftpget.exp1
-rw-r--r--test/completion/lilo.exp1
-rw-r--r--test/completion/links.exp1
-rw-r--r--test/completion/lisp.exp1
-rw-r--r--test/completion/list_admins.exp1
-rw-r--r--test/completion/list_lists.exp1
-rw-r--r--test/completion/list_members.exp1
-rw-r--r--test/completion/list_owners.exp1
-rw-r--r--test/completion/ln.exp1
-rw-r--r--test/completion/look.exp1
-rw-r--r--test/completion/ls.exp1
-rw-r--r--test/completion/lvchange.exp1
-rw-r--r--test/completion/lvcreate.exp1
-rw-r--r--test/completion/lvdisplay.exp1
-rw-r--r--test/completion/lvextend.exp1
-rw-r--r--test/completion/lvm.exp1
-rw-r--r--test/completion/lvmdiskscan.exp1
-rw-r--r--test/completion/lvreduce.exp1
-rw-r--r--test/completion/lvremove.exp1
-rw-r--r--test/completion/lvrename.exp1
-rw-r--r--test/completion/lvresize.exp1
-rw-r--r--test/completion/lvs.exp1
-rw-r--r--test/completion/lvscan.exp1
-rw-r--r--test/completion/lzma.exp1
-rw-r--r--test/completion/lzop.exp1
-rw-r--r--test/completion/m4.exp1
-rw-r--r--test/completion/macof.exp1
-rw-r--r--test/completion/mailmanctl.exp1
-rw-r--r--test/completion/mailsnarf.exp1
-rw-r--r--test/completion/make.exp1
-rw-r--r--test/completion/man.exp1
-rw-r--r--test/completion/mc.exp1
-rw-r--r--test/completion/mcrypt.exp1
-rw-r--r--test/completion/md5sum.exp1
-rw-r--r--test/completion/mdecrypt.exp1
-rw-r--r--test/completion/mencoder.exp1
-rw-r--r--test/completion/minicom.exp1
-rw-r--r--test/completion/mkdir.exp1
-rw-r--r--test/completion/mkfifo.exp1
-rw-r--r--test/completion/mkinitrd.exp1
-rw-r--r--test/completion/mkisofs.exp1
-rw-r--r--test/completion/mknod.exp1
-rw-r--r--test/completion/mmsitepass.exp1
-rw-r--r--test/completion/module.exp1
-rw-r--r--test/completion/mogrify.exp1
-rw-r--r--test/completion/montage.exp1
-rw-r--r--test/completion/mount.exp1
-rw-r--r--test/completion/mplayer.exp1
-rw-r--r--test/completion/msgsnarf.exp1
-rw-r--r--test/completion/mtx.exp1
-rw-r--r--test/completion/mutt.exp1
-rw-r--r--test/completion/muttng.exp1
-rw-r--r--test/completion/mv.exp1
-rw-r--r--test/completion/mysqladmin.exp1
-rw-r--r--test/completion/ncftp.exp1
-rw-r--r--test/completion/netstat.exp1
-rw-r--r--test/completion/newlist.exp1
-rw-r--r--test/completion/nl.exp1
-rw-r--r--test/completion/nm.exp1
-rw-r--r--test/completion/ntpdate.exp1
-rw-r--r--test/completion/objcopy.exp1
-rw-r--r--test/completion/objdump.exp1
-rw-r--r--test/completion/od.exp1
-rw-r--r--test/completion/openssl.exp1
-rw-r--r--test/completion/p4.exp1
-rw-r--r--test/completion/pack200.exp1
-rw-r--r--test/completion/paste.exp1
-rw-r--r--test/completion/patch.exp1
-rw-r--r--test/completion/perl.exp1
-rw-r--r--test/completion/perldoc.exp1
-rw-r--r--test/completion/pgrep.exp1
-rw-r--r--test/completion/pine.exp1
-rw-r--r--test/completion/ping.exp1
-rw-r--r--test/completion/pkg-config.exp1
-rw-r--r--test/completion/pkg_deinstall.exp1
-rw-r--r--test/completion/pkg_delete.exp1
-rw-r--r--test/completion/pkg_info.exp1
-rw-r--r--test/completion/pkill.exp1
-rw-r--r--test/completion/portinstall.exp1
-rw-r--r--test/completion/portupgrade.exp1
-rw-r--r--test/completion/povray.exp1
-rw-r--r--test/completion/pr.exp1
-rw-r--r--test/completion/psql.exp1
-rw-r--r--test/completion/ptx.exp1
-rw-r--r--test/completion/pvchange.exp1
-rw-r--r--test/completion/pvcreate.exp1
-rw-r--r--test/completion/pvdisplay.exp1
-rw-r--r--test/completion/pvmove.exp1
-rw-r--r--test/completion/pvremove.exp1
-rw-r--r--test/completion/pvs.exp1
-rw-r--r--test/completion/pvscan.exp1
-rw-r--r--test/completion/python.exp1
-rw-r--r--test/completion/qrunner.exp1
-rw-r--r--test/completion/querybts.exp1
-rw-r--r--test/completion/rcs.exp1
-rw-r--r--test/completion/rcsdiff.exp1
-rw-r--r--test/completion/rdict.exp1
-rw-r--r--test/completion/readelf.exp1
-rw-r--r--test/completion/readonly.exp1
-rw-r--r--test/completion/remove_members.exp1
-rw-r--r--test/completion/removepkg.exp1
-rw-r--r--test/completion/renice.exp1
-rw-r--r--test/completion/reportbug.exp1
-rw-r--r--test/completion/ri.exp1
-rw-r--r--test/completion/rlog.exp1
-rw-r--r--test/completion/rm.exp1
-rw-r--r--test/completion/rmdir.exp1
-rw-r--r--test/completion/rmlist.exp1
-rw-r--r--test/completion/rpcdebug.exp1
-rw-r--r--test/completion/rpm.exp1
-rw-r--r--test/completion/rsync.exp1
-rw-r--r--test/completion/rtcwake.exp1
-rw-r--r--test/completion/sbcl-mt.exp1
-rw-r--r--test/completion/sbcl.exp1
-rw-r--r--test/completion/scp.exp1
-rw-r--r--test/completion/screen.exp1
-rw-r--r--test/completion/sed.exp1
-rw-r--r--test/completion/seq.exp1
-rw-r--r--test/completion/service.exp1
-rw-r--r--test/completion/set.exp1
-rw-r--r--test/completion/sftp.exp1
-rw-r--r--test/completion/sha1sum.exp1
-rw-r--r--test/completion/shar.exp1
-rw-r--r--test/completion/sitecopy.exp1
-rw-r--r--test/completion/smartctl.exp1
-rw-r--r--test/completion/snownews.exp1
-rw-r--r--test/completion/sort.exp1
-rw-r--r--test/completion/split.exp1
-rw-r--r--test/completion/spovray.exp1
-rw-r--r--test/completion/ssh.exp1
-rw-r--r--test/completion/sshmitm.exp1
-rw-r--r--test/completion/sshow.exp1
-rw-r--r--test/completion/strace.exp1
-rw-r--r--test/completion/strip.exp1
-rw-r--r--test/completion/sudo.exp1
-rw-r--r--test/completion/svk.exp1
-rw-r--r--test/completion/svn.exp1
-rw-r--r--test/completion/svnadmin.exp1
-rw-r--r--test/completion/svnlook.exp1
-rw-r--r--test/completion/sync_members.exp1
-rw-r--r--test/completion/sysctl.exp1
-rw-r--r--test/completion/tac.exp1
-rw-r--r--test/completion/tail.exp1
-rw-r--r--test/completion/tar.exp1
-rw-r--r--test/completion/tcpkill.exp1
-rw-r--r--test/completion/tcpnice.exp1
-rw-r--r--test/completion/tee.exp1
-rw-r--r--test/completion/texindex.exp1
-rw-r--r--test/completion/tightvncviewer.exp1
-rw-r--r--test/completion/time.exp1
-rw-r--r--test/completion/touch.exp1
-rw-r--r--test/completion/tr.exp1
-rw-r--r--test/completion/unace.exp1
-rw-r--r--test/completion/uname.exp1
-rw-r--r--test/completion/unexpand.exp1
-rw-r--r--test/completion/uniq.exp1
-rw-r--r--test/completion/units.exp1
-rw-r--r--test/completion/unpack200.exp1
-rw-r--r--test/completion/unrar.exp1
-rw-r--r--test/completion/unset.exp1
-rw-r--r--test/completion/unshunt.exp1
-rw-r--r--test/completion/update-alternatives.exp1
-rw-r--r--test/completion/update-rc.d.exp1
-rw-r--r--test/completion/urlsnarf.exp1
-rw-r--r--test/completion/vdir.exp1
-rw-r--r--test/completion/vgcfgbackup.exp1
-rw-r--r--test/completion/vgcfgrestore.exp1
-rw-r--r--test/completion/vgchange.exp1
-rw-r--r--test/completion/vgck.exp1
-rw-r--r--test/completion/vgconvert.exp1
-rw-r--r--test/completion/vgcreate.exp1
-rw-r--r--test/completion/vgdisplay.exp1
-rw-r--r--test/completion/vgexport.exp1
-rw-r--r--test/completion/vgextend.exp1
-rw-r--r--test/completion/vgimport.exp1
-rw-r--r--test/completion/vgmerge.exp1
-rw-r--r--test/completion/vgmknodes.exp1
-rw-r--r--test/completion/vgreduce.exp1
-rw-r--r--test/completion/vgremove.exp1
-rw-r--r--test/completion/vgrename.exp1
-rw-r--r--test/completion/vgs.exp1
-rw-r--r--test/completion/vgscan.exp1
-rw-r--r--test/completion/vgsplit.exp1
-rw-r--r--test/completion/vncviewer.exp1
-rw-r--r--test/completion/wc.exp1
-rw-r--r--test/completion/webmitm.exp1
-rw-r--r--test/completion/wget.exp1
-rw-r--r--test/completion/who.exp1
-rw-r--r--test/completion/withlist.exp1
-rw-r--r--test/completion/wol.exp1
-rw-r--r--test/completion/wtf.exp1
-rw-r--r--test/completion/wvdial.exp1
-rw-r--r--test/completion/xhost.exp1
-rw-r--r--test/completion/xmllint.exp1
-rw-r--r--test/completion/xmlwf.exp1
-rw-r--r--test/completion/xmms.exp1
-rw-r--r--test/completion/xpovray.exp1
-rw-r--r--test/completion/xrandr.exp1
-rw-r--r--test/completion/xsltproc.exp1
-rw-r--r--test/completion/xvnc4viewer.exp1
-rw-r--r--test/completion/xz.exp1
-rw-r--r--test/completion/ypcat.exp1
-rw-r--r--test/completion/ypmatch.exp1
-rw-r--r--test/completion/yum-arch.exp1
-rw-r--r--test/completion/yum.exp1
-rw-r--r--test/config/bashrc42
-rw-r--r--test/config/default.exp23
-rw-r--r--test/config/inputrc21
-rw-r--r--test/fixtures/_filedir/a b/i0
-rw-r--r--test/fixtures/_filedir/a"b/d0
-rw-r--r--test/fixtures/_filedir/a$b/h0
-rw-r--r--test/fixtures/_filedir/a&b/f0
-rw-r--r--test/fixtures/_filedir/a'b/c0
-rw-r--r--test/fixtures/_filedir/ab/e0
-rw-r--r--test/fixtures/_filedir/aé/g0
-rw-r--r--test/fixtures/_filedir/ext/ee.e10
-rw-r--r--test/fixtures/_filedir/ext/ff.e20
-rw-r--r--test/fixtures/_filedir/ext/foo/.gitignore0
-rw-r--r--test/fixtures/_filedir/ext/gg.e10
-rw-r--r--test/fixtures/_filedir/ext/hh.e20
-rw-r--r--test/fixtures/_known_hosts_real/config6
-rw-r--r--test/fixtures/_known_hosts_real/config_tilde4
-rw-r--r--test/fixtures/_known_hosts_real/known_hosts6
-rw-r--r--test/fixtures/_known_hosts_real/known_hosts21
-rw-r--r--test/fixtures/_known_hosts_real/known_hosts31
-rw-r--r--test/fixtures/_known_hosts_real/spaced conf9
-rw-r--r--test/fixtures/_known_hosts_real/spaced known_hosts4
-rw-r--r--test/fixtures/compgen/a'b/c0
-rw-r--r--test/fixtures/compgen/t1.txt121
-rw-r--r--test/fixtures/compgen/t2.txt121
-rw-r--r--test/fixtures/compgen/t3.txt121
-rw-r--r--test/fixtures/cvs/.cvspass2
-rw-r--r--test/fixtures/evince/.BMP0
-rw-r--r--test/fixtures/evince/.CBR0
-rw-r--r--test/fixtures/evince/.CBZ0
-rw-r--r--test/fixtures/evince/.DJV0
-rw-r--r--test/fixtures/evince/.DJVU0
-rw-r--r--test/fixtures/evince/.DVI0
-rw-r--r--test/fixtures/evince/.DVI.BZ20
-rw-r--r--test/fixtures/evince/.DVI.GZ0
-rw-r--r--test/fixtures/evince/.DVI.bz20
-rw-r--r--test/fixtures/evince/.DVI.gz0
-rw-r--r--test/fixtures/evince/.EPS0
-rw-r--r--test/fixtures/evince/.EPS.BZ20
-rw-r--r--test/fixtures/evince/.EPS.GZ0
-rw-r--r--test/fixtures/evince/.EPS.bz20
-rw-r--r--test/fixtures/evince/.EPS.gz0
-rw-r--r--test/fixtures/evince/.GIF0
-rw-r--r--test/fixtures/evince/.ICO0
-rw-r--r--test/fixtures/evince/.JPEG0
-rw-r--r--test/fixtures/evince/.JPG0
-rw-r--r--test/fixtures/evince/.MIFF0
-rw-r--r--test/fixtures/evince/.PBM0
-rw-r--r--test/fixtures/evince/.PCX0
-rw-r--r--test/fixtures/evince/.PDF0
-rw-r--r--test/fixtures/evince/.PDF.BZ20
-rw-r--r--test/fixtures/evince/.PDF.GZ0
-rw-r--r--test/fixtures/evince/.PDF.bz20
-rw-r--r--test/fixtures/evince/.PDF.gz0
-rw-r--r--test/fixtures/evince/.PGM0
-rw-r--r--test/fixtures/evince/.PNG0
-rw-r--r--test/fixtures/evince/.PNM0
-rw-r--r--test/fixtures/evince/.PPM0
-rw-r--r--test/fixtures/evince/.PS0
-rw-r--r--test/fixtures/evince/.PS.BZ20
-rw-r--r--test/fixtures/evince/.PS.GZ0
-rw-r--r--test/fixtures/evince/.PS.bz20
-rw-r--r--test/fixtures/evince/.PS.gz0
-rw-r--r--test/fixtures/evince/.TGA0
-rw-r--r--test/fixtures/evince/.TIF0
-rw-r--r--test/fixtures/evince/.TIFF0
-rw-r--r--test/fixtures/evince/.XPM0
-rw-r--r--test/fixtures/evince/.XWD0
-rw-r--r--test/fixtures/evince/.bmp0
-rw-r--r--test/fixtures/evince/.cbr0
-rw-r--r--test/fixtures/evince/.cbz0
-rw-r--r--test/fixtures/evince/.djv0
-rw-r--r--test/fixtures/evince/.djvu0
-rw-r--r--test/fixtures/evince/.dvi0
-rw-r--r--test/fixtures/evince/.dvi.BZ20
-rw-r--r--test/fixtures/evince/.dvi.GZ0
-rw-r--r--test/fixtures/evince/.dvi.bz20
-rw-r--r--test/fixtures/evince/.dvi.gz0
-rw-r--r--test/fixtures/evince/.eps0
-rw-r--r--test/fixtures/evince/.eps.BZ20
-rw-r--r--test/fixtures/evince/.eps.GZ0
-rw-r--r--test/fixtures/evince/.eps.bz20
-rw-r--r--test/fixtures/evince/.eps.gz0
-rw-r--r--test/fixtures/evince/.gif0
-rw-r--r--test/fixtures/evince/.ico0
-rw-r--r--test/fixtures/evince/.jpeg0
-rw-r--r--test/fixtures/evince/.jpg0
-rw-r--r--test/fixtures/evince/.miff0
-rw-r--r--test/fixtures/evince/.pbm0
-rw-r--r--test/fixtures/evince/.pcx0
-rw-r--r--test/fixtures/evince/.pdf0
-rw-r--r--test/fixtures/evince/.pdf.BZ20
-rw-r--r--test/fixtures/evince/.pdf.GZ0
-rw-r--r--test/fixtures/evince/.pdf.bz20
-rw-r--r--test/fixtures/evince/.pdf.gz0
-rw-r--r--test/fixtures/evince/.pgm0
-rw-r--r--test/fixtures/evince/.png0
-rw-r--r--test/fixtures/evince/.pnm0
-rw-r--r--test/fixtures/evince/.ppm0
-rw-r--r--test/fixtures/evince/.ps0
-rw-r--r--test/fixtures/evince/.ps.BZ20
-rw-r--r--test/fixtures/evince/.ps.GZ0
-rw-r--r--test/fixtures/evince/.ps.bz20
-rw-r--r--test/fixtures/evince/.ps.gz0
-rw-r--r--test/fixtures/evince/.tga0
-rw-r--r--test/fixtures/evince/.tif0
-rw-r--r--test/fixtures/evince/.tiff0
-rw-r--r--test/fixtures/evince/.txt0
-rw-r--r--test/fixtures/evince/.xpm0
-rw-r--r--test/fixtures/evince/.xwd0
-rw-r--r--test/fixtures/evince/foo/.gitignore0
-rw-r--r--test/fixtures/isql/odbc.ini3
-rw-r--r--test/fixtures/java/a/b$c.class0
-rw-r--r--test/fixtures/java/a/b.class0
-rw-r--r--test/fixtures/java/a/c/README.txt2
-rw-r--r--test/fixtures/java/a/c/d.class0
-rw-r--r--test/fixtures/java/a/d.txt0
-rw-r--r--test/fixtures/java/bashcomp.jarbin0 -> 788 bytes
-rw-r--r--test/fixtures/kdvi/.DVI0
-rw-r--r--test/fixtures/kdvi/.DVI.Z0
-rw-r--r--test/fixtures/kdvi/.DVI.bz20
-rw-r--r--test/fixtures/kdvi/.DVI.gz0
-rw-r--r--test/fixtures/kdvi/.dvi0
-rw-r--r--test/fixtures/kdvi/.dvi.Z0
-rw-r--r--test/fixtures/kdvi/.dvi.bz20
-rw-r--r--test/fixtures/kdvi/.dvi.gz0
-rw-r--r--test/fixtures/kdvi/.txt0
-rw-r--r--test/fixtures/kdvi/foo/.gitignore0
-rw-r--r--test/fixtures/kpdf/.EPS0
-rw-r--r--test/fixtures/kpdf/.PDF0
-rw-r--r--test/fixtures/kpdf/.PS0
-rw-r--r--test/fixtures/kpdf/.eps0
-rw-r--r--test/fixtures/kpdf/.pdf0
-rw-r--r--test/fixtures/kpdf/.ps0
-rw-r--r--test/fixtures/kpdf/.txt0
-rw-r--r--test/fixtures/kpdf/foo/.gitignore0
-rw-r--r--test/fixtures/lftp/.lftp/bookmarks1
-rwxr-xr-xtest/fixtures/mount/bin/showmount12
-rw-r--r--test/fixtures/mount/test-fstab24
-rw-r--r--test/fixtures/mutt/bar/.gitignore0
-rw-r--r--test/fixtures/mutt/foo/.gitignore0
-rw-r--r--test/fixtures/mutt/muttrc3
-rw-r--r--test/fixtures/pkgtools/db/a-1.0,1/.gitignore0
-rw-r--r--test/fixtures/pkgtools/db/b-c-d-2.0_2/.gitignore0
-rw-r--r--test/fixtures/pkgtools/ports/.gitignore2
-rw-r--r--test/fixtures/pkgtools/ports/INDEX.dist3
-rw-r--r--test/fixtures/scp/config6
-rw-r--r--test/fixtures/scp/known_hosts4
-rw-r--r--test/fixtures/scp/spaced conf6
-rw-r--r--test/fixtures/sftp/config6
-rw-r--r--test/fixtures/sftp/known_hosts4
-rw-r--r--test/fixtures/sftp/spaced conf6
-rwxr-xr-xtest/fixtures/shared/bin/arp16
-rwxr-xr-xtest/fixtures/shared/bin/ifconfig24
-rw-r--r--test/fixtures/shared/default/bar0
-rw-r--r--test/fixtures/shared/default/bar bar.d/foo0
-rw-r--r--test/fixtures/shared/default/foo1
-rw-r--r--test/fixtures/shared/default/foo.d/foo0
-rw-r--r--test/fixtures/ssh/config1
-rw-r--r--test/fixtures/ssh/known_hosts5
-rw-r--r--test/fixtures/ssh/spaced conf6
-rw-r--r--test/fixtures/xz/a/b0
-rw-r--r--test/fixtures/xz/bashcomp.lzma0
-rw-r--r--test/fixtures/xz/bashcomp.tar0
-rw-r--r--test/fixtures/xz/bashcomp.tar.xzbin0 -> 196 bytes
-rw-r--r--test/fixtures/xz/bashcomp.tlz0
-rw-r--r--test/fixtures/xz/bashcomp.xz0
-rw-r--r--test/lib/completion.exp16
-rw-r--r--test/lib/completions/a2ps.exp20
-rw-r--r--test/lib/completions/abook.exp20
-rw-r--r--test/lib/completions/acroread.exp22
-rw-r--r--test/lib/completions/add_members.exp20
-rw-r--r--test/lib/completions/alias.exp43
-rw-r--r--test/lib/completions/animate.exp20
-rw-r--r--test/lib/completions/ant.exp20
-rw-r--r--test/lib/completions/apache2ctl.exp20
-rw-r--r--test/lib/completions/apt-build.exp20
-rw-r--r--test/lib/completions/apt-cache.exp20
-rw-r--r--test/lib/completions/apt-get.exp22
-rw-r--r--test/lib/completions/aptitude.exp20
-rw-r--r--test/lib/completions/arch.exp21
-rw-r--r--test/lib/completions/arpspoof.exp20
-rw-r--r--test/lib/completions/aspell.exp20
-rw-r--r--test/lib/completions/autoconf.exp20
-rw-r--r--test/lib/completions/automake.exp20
-rw-r--r--test/lib/completions/autorpm.exp20
-rw-r--r--test/lib/completions/awk.exp20
-rw-r--r--test/lib/completions/bash.exp20
-rw-r--r--test/lib/completions/bc.exp20
-rw-r--r--test/lib/completions/bison.exp20
-rw-r--r--test/lib/completions/bk.exp20
-rw-r--r--test/lib/completions/brctl.exp20
-rw-r--r--test/lib/completions/btdownloadcurses.py.exp20
-rw-r--r--test/lib/completions/btdownloadgui.py.exp20
-rw-r--r--test/lib/completions/btdownloadheadless.py.exp20
-rw-r--r--test/lib/completions/bzip2.exp20
-rw-r--r--test/lib/completions/c++.exp21
-rw-r--r--test/lib/completions/cancel.exp31
-rw-r--r--test/lib/completions/cardctl.exp20
-rw-r--r--test/lib/completions/cat.exp20
-rw-r--r--test/lib/completions/cc.exp20
-rw-r--r--test/lib/completions/cd.exp47
-rw-r--r--test/lib/completions/cdrecord.exp20
-rw-r--r--test/lib/completions/change_pw.exp20
-rw-r--r--test/lib/completions/check_db.exp20
-rw-r--r--test/lib/completions/check_perms.exp20
-rw-r--r--test/lib/completions/chgrp.exp20
-rw-r--r--test/lib/completions/chkconfig.exp20
-rw-r--r--test/lib/completions/chown.exp72
-rw-r--r--test/lib/completions/chsh.exp26
-rw-r--r--test/lib/completions/ci.exp20
-rw-r--r--test/lib/completions/civclient.exp20
-rw-r--r--test/lib/completions/civserver.exp20
-rw-r--r--test/lib/completions/cksfv.exp20
-rw-r--r--test/lib/completions/cleanarch.exp20
-rw-r--r--test/lib/completions/clisp.exp20
-rw-r--r--test/lib/completions/clone_member.exp20
-rw-r--r--test/lib/completions/co.exp20
-rw-r--r--test/lib/completions/composite.exp20
-rw-r--r--test/lib/completions/config_list.exp20
-rw-r--r--test/lib/completions/configure.exp20
-rw-r--r--test/lib/completions/convert.exp20
-rw-r--r--test/lib/completions/cowsay.exp20
-rw-r--r--test/lib/completions/cp.exp20
-rw-r--r--test/lib/completions/cpio.exp26
-rw-r--r--test/lib/completions/createdb.exp20
-rw-r--r--test/lib/completions/cryptsetup.exp20
-rw-r--r--test/lib/completions/csplit.exp20
-rw-r--r--test/lib/completions/cut.exp20
-rw-r--r--test/lib/completions/cvs.exp36
-rw-r--r--test/lib/completions/cvsps.exp36
-rw-r--r--test/lib/completions/date.exp20
-rw-r--r--test/lib/completions/dcop.exp22
-rw-r--r--test/lib/completions/dd.exp33
-rw-r--r--test/lib/completions/df.exp20
-rw-r--r--test/lib/completions/dhclient.exp20
-rw-r--r--test/lib/completions/dict.exp20
-rw-r--r--test/lib/completions/diff.exp20
-rw-r--r--test/lib/completions/dir.exp20
-rw-r--r--test/lib/completions/display.exp41
-rw-r--r--test/lib/completions/dnsspoof.exp20
-rw-r--r--test/lib/completions/dpkg-deb.exp20
-rw-r--r--test/lib/completions/dpkg-reconfigure.exp20
-rw-r--r--test/lib/completions/dpkg-source.exp20
-rw-r--r--test/lib/completions/dpkg.exp29
-rw-r--r--test/lib/completions/dropdb.exp20
-rw-r--r--test/lib/completions/dselect.exp20
-rw-r--r--test/lib/completions/dsniff.exp20
-rw-r--r--test/lib/completions/du.exp20
-rw-r--r--test/lib/completions/dumpdb.exp20
-rw-r--r--test/lib/completions/enscript.exp20
-rw-r--r--test/lib/completions/env.exp22
-rw-r--r--test/lib/completions/evince.exp35
-rw-r--r--test/lib/completions/expand.exp22
-rw-r--r--test/lib/completions/filesnarf.exp20
-rw-r--r--test/lib/completions/find.exp80
-rw-r--r--test/lib/completions/find_member.exp20
-rw-r--r--test/lib/completions/finger.exp57
-rw-r--r--test/lib/completions/fmt.exp22
-rw-r--r--test/lib/completions/fold.exp22
-rw-r--r--test/lib/completions/g++.exp20
-rw-r--r--test/lib/completions/g4.exp20
-rw-r--r--test/lib/completions/g77.exp20
-rw-r--r--test/lib/completions/gcc.exp20
-rw-r--r--test/lib/completions/gcj.exp20
-rw-r--r--test/lib/completions/gcl.exp20
-rw-r--r--test/lib/completions/gdb.exp20
-rw-r--r--test/lib/completions/genaliases.exp20
-rw-r--r--test/lib/completions/getent.exp20
-rw-r--r--test/lib/completions/gkrellm.exp20
-rw-r--r--test/lib/completions/gmplayer.exp20
-rw-r--r--test/lib/completions/gnatmake.exp20
-rw-r--r--test/lib/completions/gpc.exp20
-rw-r--r--test/lib/completions/gperf.exp20
-rw-r--r--test/lib/completions/gpg.exp20
-rw-r--r--test/lib/completions/gprof.exp22
-rw-r--r--test/lib/completions/grep.exp20
-rw-r--r--test/lib/completions/grub.exp20
-rw-r--r--test/lib/completions/gzip.exp28
-rw-r--r--test/lib/completions/hcitool.exp20
-rw-r--r--test/lib/completions/head.exp22
-rw-r--r--test/lib/completions/iconv.exp20
-rw-r--r--test/lib/completions/id.exp20
-rw-r--r--test/lib/completions/identify.exp20
-rw-r--r--test/lib/completions/ifdown.exp20
-rw-r--r--test/lib/completions/ifup.exp20
-rw-r--r--test/lib/completions/indent.exp20
-rw-r--r--test/lib/completions/info.exp20
-rw-r--r--test/lib/completions/inject.exp20
-rw-r--r--test/lib/completions/insmod.exp20
-rw-r--r--test/lib/completions/invoke-rc.d.exp20
-rw-r--r--test/lib/completions/ipsec.exp20
-rw-r--r--test/lib/completions/ipv6calc.exp26
-rw-r--r--test/lib/completions/irb.exp20
-rw-r--r--test/lib/completions/isql.exp23
-rw-r--r--test/lib/completions/iwconfig.exp20
-rw-r--r--test/lib/completions/iwlist.exp20
-rw-r--r--test/lib/completions/iwpriv.exp20
-rw-r--r--test/lib/completions/iwspy.exp20
-rw-r--r--test/lib/completions/jar.exp20
-rw-r--r--test/lib/completions/jarsigner.exp20
-rw-r--r--test/lib/completions/java.exp46
-rw-r--r--test/lib/completions/javac.exp20
-rw-r--r--test/lib/completions/javadoc.exp20
-rw-r--r--test/lib/completions/k3b.exp20
-rw-r--r--test/lib/completions/kdvi.exp27
-rw-r--r--test/lib/completions/kill.exp26
-rw-r--r--test/lib/completions/killall.exp26
-rw-r--r--test/lib/completions/kldload.exp20
-rw-r--r--test/lib/completions/kldunload.exp24
-rw-r--r--test/lib/completions/kpdf.exp26
-rw-r--r--test/lib/completions/kplayer.exp20
-rw-r--r--test/lib/completions/larch.exp20
-rw-r--r--test/lib/completions/ld.exp20
-rw-r--r--test/lib/completions/ldd.exp20
-rw-r--r--test/lib/completions/less.exp20
-rw-r--r--test/lib/completions/lftp.exp24
-rw-r--r--test/lib/completions/lftpget.exp20
-rw-r--r--test/lib/completions/lilo.exp20
-rw-r--r--test/lib/completions/links.exp20
-rw-r--r--test/lib/completions/lisp.exp20
-rw-r--r--test/lib/completions/list_admins.exp20
-rw-r--r--test/lib/completions/list_lists.exp20
-rw-r--r--test/lib/completions/list_members.exp20
-rw-r--r--test/lib/completions/list_owners.exp20
-rw-r--r--test/lib/completions/ln.exp20
-rw-r--r--test/lib/completions/look.exp22
-rw-r--r--test/lib/completions/ls.exp22
-rw-r--r--test/lib/completions/lvchange.exp20
-rw-r--r--test/lib/completions/lvcreate.exp20
-rw-r--r--test/lib/completions/lvdisplay.exp20
-rw-r--r--test/lib/completions/lvextend.exp20
-rw-r--r--test/lib/completions/lvm.exp20
-rw-r--r--test/lib/completions/lvmdiskscan.exp20
-rw-r--r--test/lib/completions/lvreduce.exp20
-rw-r--r--test/lib/completions/lvremove.exp20
-rw-r--r--test/lib/completions/lvrename.exp20
-rw-r--r--test/lib/completions/lvresize.exp20
-rw-r--r--test/lib/completions/lvs.exp20
-rw-r--r--test/lib/completions/lvscan.exp20
-rw-r--r--test/lib/completions/lzma.exp26
-rw-r--r--test/lib/completions/lzop.exp20
-rw-r--r--test/lib/completions/m4.exp22
-rw-r--r--test/lib/completions/macof.exp20
-rw-r--r--test/lib/completions/mailmanctl.exp20
-rw-r--r--test/lib/completions/mailsnarf.exp20
-rw-r--r--test/lib/completions/make.exp20
-rw-r--r--test/lib/completions/man.exp20
-rw-r--r--test/lib/completions/mc.exp20
-rw-r--r--test/lib/completions/mcrypt.exp20
-rw-r--r--test/lib/completions/md5sum.exp20
-rw-r--r--test/lib/completions/mdecrypt.exp20
-rw-r--r--test/lib/completions/mencoder.exp20
-rw-r--r--test/lib/completions/minicom.exp20
-rw-r--r--test/lib/completions/mkdir.exp20
-rw-r--r--test/lib/completions/mkfifo.exp20
-rw-r--r--test/lib/completions/mkinitrd.exp20
-rw-r--r--test/lib/completions/mkisofs.exp48
-rw-r--r--test/lib/completions/mknod.exp20
-rw-r--r--test/lib/completions/mmsitepass.exp20
-rw-r--r--test/lib/completions/module.exp20
-rw-r--r--test/lib/completions/mogrify.exp20
-rw-r--r--test/lib/completions/montage.exp20
-rw-r--r--test/lib/completions/mount.exp121
-rw-r--r--test/lib/completions/mplayer.exp20
-rw-r--r--test/lib/completions/msgsnarf.exp20
-rw-r--r--test/lib/completions/mtx.exp20
-rw-r--r--test/lib/completions/mutt.exp33
-rw-r--r--test/lib/completions/muttng.exp20
-rw-r--r--test/lib/completions/mv.exp20
-rw-r--r--test/lib/completions/mysqladmin.exp20
-rw-r--r--test/lib/completions/ncftp.exp20
-rw-r--r--test/lib/completions/netstat.exp20
-rw-r--r--test/lib/completions/newlist.exp20
-rw-r--r--test/lib/completions/nl.exp20
-rw-r--r--test/lib/completions/nm.exp20
-rw-r--r--test/lib/completions/ntpdate.exp20
-rw-r--r--test/lib/completions/objcopy.exp20
-rw-r--r--test/lib/completions/objdump.exp20
-rw-r--r--test/lib/completions/od.exp20
-rw-r--r--test/lib/completions/openssl.exp28
-rw-r--r--test/lib/completions/p4.exp20
-rw-r--r--test/lib/completions/pack200.exp20
-rw-r--r--test/lib/completions/paste.exp20
-rw-r--r--test/lib/completions/patch.exp20
-rw-r--r--test/lib/completions/perl.exp95
-rw-r--r--test/lib/completions/perldoc.exp38
-rw-r--r--test/lib/completions/pgrep.exp20
-rw-r--r--test/lib/completions/pine.exp20
-rw-r--r--test/lib/completions/ping.exp20
-rw-r--r--test/lib/completions/pkg-config.exp20
-rw-r--r--test/lib/completions/pkg_deinstall.exp22
-rw-r--r--test/lib/completions/pkg_delete.exp20
-rw-r--r--test/lib/completions/pkg_info.exp20
-rw-r--r--test/lib/completions/pkill.exp20
-rw-r--r--test/lib/completions/portinstall.exp22
-rw-r--r--test/lib/completions/portupgrade.exp21
-rw-r--r--test/lib/completions/povray.exp20
-rw-r--r--test/lib/completions/pr.exp20
-rw-r--r--test/lib/completions/psql.exp20
-rw-r--r--test/lib/completions/ptx.exp20
-rw-r--r--test/lib/completions/pvchange.exp20
-rw-r--r--test/lib/completions/pvcreate.exp20
-rw-r--r--test/lib/completions/pvdisplay.exp20
-rw-r--r--test/lib/completions/pvmove.exp20
-rw-r--r--test/lib/completions/pvremove.exp20
-rw-r--r--test/lib/completions/pvs.exp20
-rw-r--r--test/lib/completions/pvscan.exp20
-rw-r--r--test/lib/completions/python.exp20
-rw-r--r--test/lib/completions/qrunner.exp20
-rw-r--r--test/lib/completions/querybts.exp20
-rw-r--r--test/lib/completions/rcs.exp20
-rw-r--r--test/lib/completions/rcsdiff.exp20
-rw-r--r--test/lib/completions/rdict.exp20
-rw-r--r--test/lib/completions/readelf.exp20
-rw-r--r--test/lib/completions/readonly.exp20
-rw-r--r--test/lib/completions/remove_members.exp20
-rw-r--r--test/lib/completions/removepkg.exp20
-rw-r--r--test/lib/completions/renice.exp42
-rw-r--r--test/lib/completions/reportbug.exp20
-rw-r--r--test/lib/completions/ri.exp20
-rw-r--r--test/lib/completions/rlog.exp20
-rw-r--r--test/lib/completions/rm.exp20
-rw-r--r--test/lib/completions/rmdir.exp20
-rw-r--r--test/lib/completions/rmlist.exp20
-rw-r--r--test/lib/completions/rpcdebug.exp20
-rw-r--r--test/lib/completions/rpm.exp29
-rw-r--r--test/lib/completions/rsync.exp20
-rw-r--r--test/lib/completions/rtcwake.exp20
-rw-r--r--test/lib/completions/sbcl-mt.exp20
-rw-r--r--test/lib/completions/sbcl.exp20
-rw-r--r--test/lib/completions/scp.exp121
-rw-r--r--test/lib/completions/screen.exp52
-rw-r--r--test/lib/completions/sed.exp22
-rw-r--r--test/lib/completions/seq.exp20
-rw-r--r--test/lib/completions/service.exp20
-rw-r--r--test/lib/completions/set.exp20
-rw-r--r--test/lib/completions/sftp.exp77
-rw-r--r--test/lib/completions/sha1sum.exp20
-rw-r--r--test/lib/completions/shar.exp20
-rw-r--r--test/lib/completions/sitecopy.exp20
-rw-r--r--test/lib/completions/smartctl.exp20
-rw-r--r--test/lib/completions/snownews.exp20
-rw-r--r--test/lib/completions/sort.exp20
-rw-r--r--test/lib/completions/split.exp22
-rw-r--r--test/lib/completions/spovray.exp20
-rw-r--r--test/lib/completions/ssh.exp93
-rw-r--r--test/lib/completions/sshmitm.exp20
-rw-r--r--test/lib/completions/sshow.exp20
-rw-r--r--test/lib/completions/strace.exp20
-rw-r--r--test/lib/completions/strip.exp20
-rw-r--r--test/lib/completions/sudo.exp20
-rw-r--r--test/lib/completions/svk.exp20
-rw-r--r--test/lib/completions/svn.exp20
-rw-r--r--test/lib/completions/svnadmin.exp20
-rw-r--r--test/lib/completions/svnlook.exp20
-rw-r--r--test/lib/completions/sync_members.exp20
-rw-r--r--test/lib/completions/sysctl.exp22
-rw-r--r--test/lib/completions/tac.exp20
-rw-r--r--test/lib/completions/tail.exp22
-rw-r--r--test/lib/completions/tar.exp20
-rw-r--r--test/lib/completions/tcpkill.exp20
-rw-r--r--test/lib/completions/tcpnice.exp20
-rw-r--r--test/lib/completions/tee.exp20
-rw-r--r--test/lib/completions/texindex.exp20
-rw-r--r--test/lib/completions/tightvncviewer.exp20
-rw-r--r--test/lib/completions/time.exp20
-rw-r--r--test/lib/completions/touch.exp22
-rw-r--r--test/lib/completions/tr.exp22
-rw-r--r--test/lib/completions/unace.exp20
-rw-r--r--test/lib/completions/uname.exp22
-rw-r--r--test/lib/completions/unexpand.exp22
-rw-r--r--test/lib/completions/uniq.exp22
-rw-r--r--test/lib/completions/units.exp22
-rw-r--r--test/lib/completions/unpack200.exp20
-rw-r--r--test/lib/completions/unrar.exp20
-rw-r--r--test/lib/completions/unset.exp20
-rw-r--r--test/lib/completions/unshunt.exp20
-rw-r--r--test/lib/completions/update-alternatives.exp20
-rw-r--r--test/lib/completions/update-rc.d.exp20
-rw-r--r--test/lib/completions/urlsnarf.exp20
-rw-r--r--test/lib/completions/vdir.exp20
-rw-r--r--test/lib/completions/vgcfgbackup.exp20
-rw-r--r--test/lib/completions/vgcfgrestore.exp20
-rw-r--r--test/lib/completions/vgchange.exp20
-rw-r--r--test/lib/completions/vgck.exp20
-rw-r--r--test/lib/completions/vgconvert.exp20
-rw-r--r--test/lib/completions/vgcreate.exp20
-rw-r--r--test/lib/completions/vgdisplay.exp20
-rw-r--r--test/lib/completions/vgexport.exp20
-rw-r--r--test/lib/completions/vgextend.exp20
-rw-r--r--test/lib/completions/vgimport.exp20
-rw-r--r--test/lib/completions/vgmerge.exp20
-rw-r--r--test/lib/completions/vgmknodes.exp20
-rw-r--r--test/lib/completions/vgreduce.exp20
-rw-r--r--test/lib/completions/vgremove.exp20
-rw-r--r--test/lib/completions/vgrename.exp20
-rw-r--r--test/lib/completions/vgs.exp20
-rw-r--r--test/lib/completions/vgscan.exp20
-rw-r--r--test/lib/completions/vgsplit.exp20
-rw-r--r--test/lib/completions/vncviewer.exp22
-rw-r--r--test/lib/completions/wc.exp22
-rw-r--r--test/lib/completions/webmitm.exp20
-rw-r--r--test/lib/completions/wget.exp20
-rw-r--r--test/lib/completions/who.exp22
-rw-r--r--test/lib/completions/withlist.exp20
-rw-r--r--test/lib/completions/wol.exp29
-rw-r--r--test/lib/completions/wtf.exp20
-rw-r--r--test/lib/completions/wvdial.exp20
-rw-r--r--test/lib/completions/xhost.exp100
-rw-r--r--test/lib/completions/xmllint.exp20
-rw-r--r--test/lib/completions/xmlwf.exp20
-rw-r--r--test/lib/completions/xmms.exp20
-rw-r--r--test/lib/completions/xpovray.exp20
-rw-r--r--test/lib/completions/xrandr.exp20
-rw-r--r--test/lib/completions/xsltproc.exp20
-rw-r--r--test/lib/completions/xvnc4viewer.exp45
-rw-r--r--test/lib/completions/xz.exp33
-rw-r--r--test/lib/completions/ypcat.exp20
-rw-r--r--test/lib/completions/ypmatch.exp20
-rw-r--r--test/lib/completions/yum-arch.exp20
-rw-r--r--test/lib/completions/yum.exp20
-rw-r--r--test/lib/library.exp908
-rw-r--r--test/lib/library.sh75
-rw-r--r--test/lib/unit.exp17
-rw-r--r--test/unit/__expand_tilde_by_ref.exp87
-rw-r--r--test/unit/_count_args.exp68
-rw-r--r--test/unit/_filedir.exp267
-rw-r--r--test/unit/_get_comp_words_by_ref.exp386
-rw-r--r--test/unit/_get_cword.exp316
-rw-r--r--test/unit/_known_hosts_real.exp118
-rw-r--r--test/unit/compgen.exp52
-rw-r--r--test/unit/find_unique_completion_pair.exp37
889 files changed, 11880 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 00000000..d955be8a
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,8 @@
+DEJATOOL = completion install unit
+AM_RUNTESTFLAGS = --outdir log
+
+EXTRA_DIST = completion \
+ config \
+ fixtures \
+ lib \
+ unit
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 00000000..a1376c9f
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,343 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
+EXPECT = expect
+RUNTEST = runtest
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+DEJATOOL = completion install unit
+AM_RUNTESTFLAGS = --outdir log
+EXTRA_DIST = completion \
+ config \
+ fixtures \
+ lib \
+ unit
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-DEJAGNU: site.exp
+ srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
+ if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+ then :; else exit_status=1; fi; \
+ done; \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi; \
+ exit $$exit_status
+site.exp: Makefile
+ @echo 'Making a new site.exp file...'
+ @echo '## these variables are automatically generated by make ##' >site.tmp
+ @echo '# Do not edit here. If you wish to override these values' >>site.tmp
+ @echo '# edit the last section' >>site.tmp
+ @echo 'set srcdir $(srcdir)' >>site.tmp
+ @echo "set objdir `pwd`" >>site.tmp
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
+ @test ! -f site.exp || \
+ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
+ @-rm -f site.bak
+ @test ! -f site.exp || mv site.exp site.bak
+ @mv site.tmp site.exp
+
+distclean-DEJAGNU:
+ -rm -f site.exp site.bak
+ -l='$(DEJATOOL)'; for tool in $$l; do \
+ rm -f $$tool.sum $$tool.log; \
+ done
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-DEJAGNU distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+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
+
+
+# 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.
+.NOEXPORT:
diff --git a/test/completion/a2ps.exp b/test/completion/a2ps.exp
new file mode 100644
index 00000000..06927b56
--- /dev/null
+++ b/test/completion/a2ps.exp
@@ -0,0 +1 @@
+assert_source_completions a2ps
diff --git a/test/completion/abook.exp b/test/completion/abook.exp
new file mode 100644
index 00000000..eaa4b308
--- /dev/null
+++ b/test/completion/abook.exp
@@ -0,0 +1 @@
+assert_source_completions abook
diff --git a/test/completion/acroread.exp b/test/completion/acroread.exp
new file mode 100644
index 00000000..c3635ae8
--- /dev/null
+++ b/test/completion/acroread.exp
@@ -0,0 +1,12 @@
+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/@$"
+expect {
+ -re $expected { pass "$test" }
+ -re /@ { fail "$test at prompt" }
+}; # expect
+
+
+source "lib/completions/acroread.exp"
diff --git a/test/completion/add_members.exp b/test/completion/add_members.exp
new file mode 100644
index 00000000..17aacd0a
--- /dev/null
+++ b/test/completion/add_members.exp
@@ -0,0 +1 @@
+assert_source_completions add_members
diff --git a/test/completion/alias.exp b/test/completion/alias.exp
new file mode 100644
index 00000000..ee7cf4bc
--- /dev/null
+++ b/test/completion/alias.exp
@@ -0,0 +1 @@
+assert_source_completions alias
diff --git a/test/completion/animate.exp b/test/completion/animate.exp
new file mode 100644
index 00000000..2f4e749e
--- /dev/null
+++ b/test/completion/animate.exp
@@ -0,0 +1 @@
+assert_source_completions animate
diff --git a/test/completion/ant.exp b/test/completion/ant.exp
new file mode 100644
index 00000000..ad6996bd
--- /dev/null
+++ b/test/completion/ant.exp
@@ -0,0 +1 @@
+assert_source_completions ant
diff --git a/test/completion/apache2ctl.exp b/test/completion/apache2ctl.exp
new file mode 100644
index 00000000..f3d5d771
--- /dev/null
+++ b/test/completion/apache2ctl.exp
@@ -0,0 +1 @@
+assert_source_completions apache2ctl
diff --git a/test/completion/apt-build.exp b/test/completion/apt-build.exp
new file mode 100644
index 00000000..48bbe583
--- /dev/null
+++ b/test/completion/apt-build.exp
@@ -0,0 +1 @@
+assert_source_completions apt-build
diff --git a/test/completion/apt-cache.exp b/test/completion/apt-cache.exp
new file mode 100644
index 00000000..901c5e87
--- /dev/null
+++ b/test/completion/apt-cache.exp
@@ -0,0 +1 @@
+assert_source_completions apt-cache
diff --git a/test/completion/apt-get.exp b/test/completion/apt-get.exp
new file mode 100644
index 00000000..04fbf631
--- /dev/null
+++ b/test/completion/apt-get.exp
@@ -0,0 +1 @@
+assert_source_completions apt-get
diff --git a/test/completion/aptitude.exp b/test/completion/aptitude.exp
new file mode 100644
index 00000000..6afbacc8
--- /dev/null
+++ b/test/completion/aptitude.exp
@@ -0,0 +1 @@
+assert_source_completions aptitude
diff --git a/test/completion/arch.exp b/test/completion/arch.exp
new file mode 100644
index 00000000..254acd53
--- /dev/null
+++ b/test/completion/arch.exp
@@ -0,0 +1 @@
+assert_source_completions arch
diff --git a/test/completion/arpspoof.exp b/test/completion/arpspoof.exp
new file mode 100644
index 00000000..d4f9341e
--- /dev/null
+++ b/test/completion/arpspoof.exp
@@ -0,0 +1 @@
+assert_source_completions arpspoof
diff --git a/test/completion/aspell.exp b/test/completion/aspell.exp
new file mode 100644
index 00000000..5592574f
--- /dev/null
+++ b/test/completion/aspell.exp
@@ -0,0 +1 @@
+assert_source_completions aspell
diff --git a/test/completion/autoconf.exp b/test/completion/autoconf.exp
new file mode 100644
index 00000000..64942435
--- /dev/null
+++ b/test/completion/autoconf.exp
@@ -0,0 +1 @@
+assert_source_completions autoconf
diff --git a/test/completion/automake.exp b/test/completion/automake.exp
new file mode 100644
index 00000000..af412413
--- /dev/null
+++ b/test/completion/automake.exp
@@ -0,0 +1 @@
+assert_source_completions automake
diff --git a/test/completion/autorpm.exp b/test/completion/autorpm.exp
new file mode 100644
index 00000000..5931bdb1
--- /dev/null
+++ b/test/completion/autorpm.exp
@@ -0,0 +1 @@
+assert_source_completions autorpm
diff --git a/test/completion/awk.exp b/test/completion/awk.exp
new file mode 100644
index 00000000..42572591
--- /dev/null
+++ b/test/completion/awk.exp
@@ -0,0 +1 @@
+assert_source_completions awk
diff --git a/test/completion/bash.exp b/test/completion/bash.exp
new file mode 100644
index 00000000..c00fc09b
--- /dev/null
+++ b/test/completion/bash.exp
@@ -0,0 +1 @@
+assert_source_completions bash
diff --git a/test/completion/bc.exp b/test/completion/bc.exp
new file mode 100644
index 00000000..8b7a3d0b
--- /dev/null
+++ b/test/completion/bc.exp
@@ -0,0 +1 @@
+assert_source_completions bc
diff --git a/test/completion/bison.exp b/test/completion/bison.exp
new file mode 100644
index 00000000..ac40cccc
--- /dev/null
+++ b/test/completion/bison.exp
@@ -0,0 +1 @@
+assert_source_completions bison
diff --git a/test/completion/bk.exp b/test/completion/bk.exp
new file mode 100644
index 00000000..10540b7a
--- /dev/null
+++ b/test/completion/bk.exp
@@ -0,0 +1 @@
+assert_source_completions bk
diff --git a/test/completion/brctl.exp b/test/completion/brctl.exp
new file mode 100644
index 00000000..efb5a75a
--- /dev/null
+++ b/test/completion/brctl.exp
@@ -0,0 +1 @@
+assert_source_completions brctl
diff --git a/test/completion/btdownloadcurses.py.exp b/test/completion/btdownloadcurses.py.exp
new file mode 100644
index 00000000..fc9d95f7
--- /dev/null
+++ b/test/completion/btdownloadcurses.py.exp
@@ -0,0 +1 @@
+assert_source_completions btdownloadcurses.py
diff --git a/test/completion/btdownloadgui.py.exp b/test/completion/btdownloadgui.py.exp
new file mode 100644
index 00000000..e617156b
--- /dev/null
+++ b/test/completion/btdownloadgui.py.exp
@@ -0,0 +1 @@
+assert_source_completions btdownloadgui.py
diff --git a/test/completion/btdownloadheadless.py.exp b/test/completion/btdownloadheadless.py.exp
new file mode 100644
index 00000000..fc4f2561
--- /dev/null
+++ b/test/completion/btdownloadheadless.py.exp
@@ -0,0 +1 @@
+assert_source_completions btdownloadheadless.py
diff --git a/test/completion/bzip2.exp b/test/completion/bzip2.exp
new file mode 100644
index 00000000..b3953144
--- /dev/null
+++ b/test/completion/bzip2.exp
@@ -0,0 +1 @@
+assert_source_completions bzip2
diff --git a/test/completion/c++.exp b/test/completion/c++.exp
new file mode 100644
index 00000000..b00bf8c2
--- /dev/null
+++ b/test/completion/c++.exp
@@ -0,0 +1 @@
+assert_source_completions c++
diff --git a/test/completion/cancel.exp b/test/completion/cancel.exp
new file mode 100644
index 00000000..67c47100
--- /dev/null
+++ b/test/completion/cancel.exp
@@ -0,0 +1 @@
+assert_source_completions cancel
diff --git a/test/completion/cardctl.exp b/test/completion/cardctl.exp
new file mode 100644
index 00000000..99d0276b
--- /dev/null
+++ b/test/completion/cardctl.exp
@@ -0,0 +1 @@
+assert_source_completions cardctl
diff --git a/test/completion/cat.exp b/test/completion/cat.exp
new file mode 100644
index 00000000..15588ac7
--- /dev/null
+++ b/test/completion/cat.exp
@@ -0,0 +1 @@
+assert_source_completions cat
diff --git a/test/completion/cc.exp b/test/completion/cc.exp
new file mode 100644
index 00000000..af39132d
--- /dev/null
+++ b/test/completion/cc.exp
@@ -0,0 +1 @@
+assert_source_completions cc
diff --git a/test/completion/cd.exp b/test/completion/cd.exp
new file mode 100644
index 00000000..94c3c598
--- /dev/null
+++ b/test/completion/cd.exp
@@ -0,0 +1 @@
+assert_source_completions cd
diff --git a/test/completion/cdrecord.exp b/test/completion/cdrecord.exp
new file mode 100644
index 00000000..9aaa7573
--- /dev/null
+++ b/test/completion/cdrecord.exp
@@ -0,0 +1 @@
+assert_source_completions cdrecord
diff --git a/test/completion/change_pw.exp b/test/completion/change_pw.exp
new file mode 100644
index 00000000..0b152a1c
--- /dev/null
+++ b/test/completion/change_pw.exp
@@ -0,0 +1 @@
+assert_source_completions change_pw
diff --git a/test/completion/check_db.exp b/test/completion/check_db.exp
new file mode 100644
index 00000000..cf136872
--- /dev/null
+++ b/test/completion/check_db.exp
@@ -0,0 +1 @@
+assert_source_completions check_db
diff --git a/test/completion/check_perms.exp b/test/completion/check_perms.exp
new file mode 100644
index 00000000..860e8d79
--- /dev/null
+++ b/test/completion/check_perms.exp
@@ -0,0 +1 @@
+assert_source_completions check_perms
diff --git a/test/completion/chgrp.exp b/test/completion/chgrp.exp
new file mode 100644
index 00000000..2b1d2251
--- /dev/null
+++ b/test/completion/chgrp.exp
@@ -0,0 +1 @@
+assert_source_completions chgrp
diff --git a/test/completion/chkconfig.exp b/test/completion/chkconfig.exp
new file mode 100644
index 00000000..38b4226d
--- /dev/null
+++ b/test/completion/chkconfig.exp
@@ -0,0 +1 @@
+assert_source_completions chkconfig
diff --git a/test/completion/chown.exp b/test/completion/chown.exp
new file mode 100644
index 00000000..53d497c2
--- /dev/null
+++ b/test/completion/chown.exp
@@ -0,0 +1 @@
+assert_source_completions chown
diff --git a/test/completion/chsh.exp b/test/completion/chsh.exp
new file mode 100644
index 00000000..3caa0c55
--- /dev/null
+++ b/test/completion/chsh.exp
@@ -0,0 +1 @@
+assert_source_completions chsh
diff --git a/test/completion/ci.exp b/test/completion/ci.exp
new file mode 100644
index 00000000..03e417a1
--- /dev/null
+++ b/test/completion/ci.exp
@@ -0,0 +1 @@
+assert_source_completions ci
diff --git a/test/completion/civclient.exp b/test/completion/civclient.exp
new file mode 100644
index 00000000..9ad3a3a6
--- /dev/null
+++ b/test/completion/civclient.exp
@@ -0,0 +1 @@
+assert_source_completions civclient
diff --git a/test/completion/civserver.exp b/test/completion/civserver.exp
new file mode 100644
index 00000000..d590e0c6
--- /dev/null
+++ b/test/completion/civserver.exp
@@ -0,0 +1 @@
+assert_source_completions civserver
diff --git a/test/completion/cksfv.exp b/test/completion/cksfv.exp
new file mode 100644
index 00000000..293096f7
--- /dev/null
+++ b/test/completion/cksfv.exp
@@ -0,0 +1 @@
+assert_source_completions cksfv
diff --git a/test/completion/cleanarch.exp b/test/completion/cleanarch.exp
new file mode 100644
index 00000000..93646e07
--- /dev/null
+++ b/test/completion/cleanarch.exp
@@ -0,0 +1 @@
+assert_source_completions cleanarch
diff --git a/test/completion/clisp.exp b/test/completion/clisp.exp
new file mode 100644
index 00000000..f4203ef4
--- /dev/null
+++ b/test/completion/clisp.exp
@@ -0,0 +1 @@
+assert_source_completions clisp
diff --git a/test/completion/clone_member.exp b/test/completion/clone_member.exp
new file mode 100644
index 00000000..04dcfe9f
--- /dev/null
+++ b/test/completion/clone_member.exp
@@ -0,0 +1 @@
+assert_source_completions clone_member
diff --git a/test/completion/co.exp b/test/completion/co.exp
new file mode 100644
index 00000000..e8babba4
--- /dev/null
+++ b/test/completion/co.exp
@@ -0,0 +1 @@
+assert_source_completions co
diff --git a/test/completion/composite.exp b/test/completion/composite.exp
new file mode 100644
index 00000000..0eaf6150
--- /dev/null
+++ b/test/completion/composite.exp
@@ -0,0 +1 @@
+assert_source_completions composite
diff --git a/test/completion/config_list.exp b/test/completion/config_list.exp
new file mode 100644
index 00000000..40986234
--- /dev/null
+++ b/test/completion/config_list.exp
@@ -0,0 +1 @@
+assert_source_completions config_list
diff --git a/test/completion/configure.exp b/test/completion/configure.exp
new file mode 100644
index 00000000..cf5611ce
--- /dev/null
+++ b/test/completion/configure.exp
@@ -0,0 +1 @@
+assert_source_completions configure
diff --git a/test/completion/convert.exp b/test/completion/convert.exp
new file mode 100644
index 00000000..27fcc6d0
--- /dev/null
+++ b/test/completion/convert.exp
@@ -0,0 +1 @@
+assert_source_completions convert
diff --git a/test/completion/cowsay.exp b/test/completion/cowsay.exp
new file mode 100644
index 00000000..b82d66d3
--- /dev/null
+++ b/test/completion/cowsay.exp
@@ -0,0 +1 @@
+assert_source_completions cowsay
diff --git a/test/completion/cp.exp b/test/completion/cp.exp
new file mode 100644
index 00000000..db7b6991
--- /dev/null
+++ b/test/completion/cp.exp
@@ -0,0 +1 @@
+assert_source_completions cp
diff --git a/test/completion/cpio.exp b/test/completion/cpio.exp
new file mode 100644
index 00000000..c3fae7ad
--- /dev/null
+++ b/test/completion/cpio.exp
@@ -0,0 +1 @@
+assert_source_completions cpio
diff --git a/test/completion/createdb.exp b/test/completion/createdb.exp
new file mode 100644
index 00000000..db76b2cc
--- /dev/null
+++ b/test/completion/createdb.exp
@@ -0,0 +1 @@
+assert_source_completions createdb
diff --git a/test/completion/cryptsetup.exp b/test/completion/cryptsetup.exp
new file mode 100644
index 00000000..c28169af
--- /dev/null
+++ b/test/completion/cryptsetup.exp
@@ -0,0 +1 @@
+assert_source_completions cryptsetup
diff --git a/test/completion/csplit.exp b/test/completion/csplit.exp
new file mode 100644
index 00000000..d1049855
--- /dev/null
+++ b/test/completion/csplit.exp
@@ -0,0 +1 @@
+assert_source_completions csplit
diff --git a/test/completion/cut.exp b/test/completion/cut.exp
new file mode 100644
index 00000000..87858132
--- /dev/null
+++ b/test/completion/cut.exp
@@ -0,0 +1 @@
+assert_source_completions cut
diff --git a/test/completion/cvs.exp b/test/completion/cvs.exp
new file mode 100644
index 00000000..3515047a
--- /dev/null
+++ b/test/completion/cvs.exp
@@ -0,0 +1 @@
+assert_source_completions cvs
diff --git a/test/completion/cvsps.exp b/test/completion/cvsps.exp
new file mode 100644
index 00000000..e6e3173c
--- /dev/null
+++ b/test/completion/cvsps.exp
@@ -0,0 +1 @@
+assert_source_completions cvsps
diff --git a/test/completion/date.exp b/test/completion/date.exp
new file mode 100644
index 00000000..098ca455
--- /dev/null
+++ b/test/completion/date.exp
@@ -0,0 +1 @@
+assert_source_completions date
diff --git a/test/completion/dcop.exp b/test/completion/dcop.exp
new file mode 100644
index 00000000..d0d0fcc0
--- /dev/null
+++ b/test/completion/dcop.exp
@@ -0,0 +1 @@
+assert_source_completions dcop
diff --git a/test/completion/dd.exp b/test/completion/dd.exp
new file mode 100644
index 00000000..e53ab66d
--- /dev/null
+++ b/test/completion/dd.exp
@@ -0,0 +1 @@
+assert_source_completions dd
diff --git a/test/completion/df.exp b/test/completion/df.exp
new file mode 100644
index 00000000..3840252d
--- /dev/null
+++ b/test/completion/df.exp
@@ -0,0 +1 @@
+assert_source_completions df
diff --git a/test/completion/dhclient.exp b/test/completion/dhclient.exp
new file mode 100644
index 00000000..ef8b6a85
--- /dev/null
+++ b/test/completion/dhclient.exp
@@ -0,0 +1 @@
+assert_source_completions dhclient
diff --git a/test/completion/dict.exp b/test/completion/dict.exp
new file mode 100644
index 00000000..0860b228
--- /dev/null
+++ b/test/completion/dict.exp
@@ -0,0 +1 @@
+assert_source_completions dict
diff --git a/test/completion/diff.exp b/test/completion/diff.exp
new file mode 100644
index 00000000..63e11c74
--- /dev/null
+++ b/test/completion/diff.exp
@@ -0,0 +1 @@
+assert_source_completions diff
diff --git a/test/completion/dir.exp b/test/completion/dir.exp
new file mode 100644
index 00000000..fa4c12fd
--- /dev/null
+++ b/test/completion/dir.exp
@@ -0,0 +1 @@
+assert_source_completions dir
diff --git a/test/completion/display.exp b/test/completion/display.exp
new file mode 100644
index 00000000..a37de277
--- /dev/null
+++ b/test/completion/display.exp
@@ -0,0 +1 @@
+assert_source_completions display
diff --git a/test/completion/dnsspoof.exp b/test/completion/dnsspoof.exp
new file mode 100644
index 00000000..c7110c58
--- /dev/null
+++ b/test/completion/dnsspoof.exp
@@ -0,0 +1 @@
+assert_source_completions dnsspoof
diff --git a/test/completion/dpkg-deb.exp b/test/completion/dpkg-deb.exp
new file mode 100644
index 00000000..4f113ec0
--- /dev/null
+++ b/test/completion/dpkg-deb.exp
@@ -0,0 +1 @@
+assert_source_completions dpkg-deb
diff --git a/test/completion/dpkg-reconfigure.exp b/test/completion/dpkg-reconfigure.exp
new file mode 100644
index 00000000..8d22071a
--- /dev/null
+++ b/test/completion/dpkg-reconfigure.exp
@@ -0,0 +1 @@
+assert_source_completions dpkg-reconfigure
diff --git a/test/completion/dpkg-source.exp b/test/completion/dpkg-source.exp
new file mode 100644
index 00000000..4a7badf8
--- /dev/null
+++ b/test/completion/dpkg-source.exp
@@ -0,0 +1 @@
+assert_source_completions dpkg-source
diff --git a/test/completion/dpkg.exp b/test/completion/dpkg.exp
new file mode 100644
index 00000000..934c3474
--- /dev/null
+++ b/test/completion/dpkg.exp
@@ -0,0 +1 @@
+assert_source_completions dpkg
diff --git a/test/completion/dropdb.exp b/test/completion/dropdb.exp
new file mode 100644
index 00000000..ce35fd5c
--- /dev/null
+++ b/test/completion/dropdb.exp
@@ -0,0 +1 @@
+assert_source_completions dropdb
diff --git a/test/completion/dselect.exp b/test/completion/dselect.exp
new file mode 100644
index 00000000..716b6a26
--- /dev/null
+++ b/test/completion/dselect.exp
@@ -0,0 +1 @@
+assert_source_completions dselect
diff --git a/test/completion/dsniff.exp b/test/completion/dsniff.exp
new file mode 100644
index 00000000..452beebb
--- /dev/null
+++ b/test/completion/dsniff.exp
@@ -0,0 +1 @@
+assert_source_completions dsniff
diff --git a/test/completion/du.exp b/test/completion/du.exp
new file mode 100644
index 00000000..ec7a9946
--- /dev/null
+++ b/test/completion/du.exp
@@ -0,0 +1 @@
+assert_source_completions du
diff --git a/test/completion/dumpdb.exp b/test/completion/dumpdb.exp
new file mode 100644
index 00000000..1bfaecc8
--- /dev/null
+++ b/test/completion/dumpdb.exp
@@ -0,0 +1 @@
+assert_source_completions dumpdb
diff --git a/test/completion/enscript.exp b/test/completion/enscript.exp
new file mode 100644
index 00000000..4ea7b029
--- /dev/null
+++ b/test/completion/enscript.exp
@@ -0,0 +1 @@
+assert_source_completions enscript
diff --git a/test/completion/env.exp b/test/completion/env.exp
new file mode 100644
index 00000000..baf3f754
--- /dev/null
+++ b/test/completion/env.exp
@@ -0,0 +1 @@
+assert_source_completions env
diff --git a/test/completion/evince.exp b/test/completion/evince.exp
new file mode 100644
index 00000000..27376e06
--- /dev/null
+++ b/test/completion/evince.exp
@@ -0,0 +1 @@
+assert_source_completions evince
diff --git a/test/completion/expand.exp b/test/completion/expand.exp
new file mode 100644
index 00000000..1bb7dd6b
--- /dev/null
+++ b/test/completion/expand.exp
@@ -0,0 +1 @@
+assert_source_completions expand
diff --git a/test/completion/filesnarf.exp b/test/completion/filesnarf.exp
new file mode 100644
index 00000000..20af6347
--- /dev/null
+++ b/test/completion/filesnarf.exp
@@ -0,0 +1 @@
+assert_source_completions filesnarf
diff --git a/test/completion/find.exp b/test/completion/find.exp
new file mode 100644
index 00000000..dc73012e
--- /dev/null
+++ b/test/completion/find.exp
@@ -0,0 +1 @@
+assert_source_completions find
diff --git a/test/completion/find_member.exp b/test/completion/find_member.exp
new file mode 100644
index 00000000..c8e4548c
--- /dev/null
+++ b/test/completion/find_member.exp
@@ -0,0 +1 @@
+assert_source_completions find_member
diff --git a/test/completion/finger.exp b/test/completion/finger.exp
new file mode 100644
index 00000000..cc77abe5
--- /dev/null
+++ b/test/completion/finger.exp
@@ -0,0 +1,6 @@
+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"
diff --git a/test/completion/fmt.exp b/test/completion/fmt.exp
new file mode 100644
index 00000000..44ed2147
--- /dev/null
+++ b/test/completion/fmt.exp
@@ -0,0 +1 @@
+assert_source_completions fmt
diff --git a/test/completion/fold.exp b/test/completion/fold.exp
new file mode 100644
index 00000000..eec92d33
--- /dev/null
+++ b/test/completion/fold.exp
@@ -0,0 +1 @@
+assert_source_completions fold
diff --git a/test/completion/g++.exp b/test/completion/g++.exp
new file mode 100644
index 00000000..9635d93e
--- /dev/null
+++ b/test/completion/g++.exp
@@ -0,0 +1 @@
+assert_source_completions g++
diff --git a/test/completion/g4.exp b/test/completion/g4.exp
new file mode 100644
index 00000000..7bf0b164
--- /dev/null
+++ b/test/completion/g4.exp
@@ -0,0 +1 @@
+assert_source_completions g4
diff --git a/test/completion/g77.exp b/test/completion/g77.exp
new file mode 100644
index 00000000..9a78cac8
--- /dev/null
+++ b/test/completion/g77.exp
@@ -0,0 +1 @@
+assert_source_completions g77
diff --git a/test/completion/gcc.exp b/test/completion/gcc.exp
new file mode 100644
index 00000000..749fafeb
--- /dev/null
+++ b/test/completion/gcc.exp
@@ -0,0 +1 @@
+assert_source_completions gcc
diff --git a/test/completion/gcj.exp b/test/completion/gcj.exp
new file mode 100644
index 00000000..88ca9ff3
--- /dev/null
+++ b/test/completion/gcj.exp
@@ -0,0 +1 @@
+assert_source_completions gcj
diff --git a/test/completion/gcl.exp b/test/completion/gcl.exp
new file mode 100644
index 00000000..ba2ff758
--- /dev/null
+++ b/test/completion/gcl.exp
@@ -0,0 +1 @@
+assert_source_completions gcl
diff --git a/test/completion/gdb.exp b/test/completion/gdb.exp
new file mode 100644
index 00000000..2b09307f
--- /dev/null
+++ b/test/completion/gdb.exp
@@ -0,0 +1 @@
+assert_source_completions gdb
diff --git a/test/completion/genaliases.exp b/test/completion/genaliases.exp
new file mode 100644
index 00000000..eeee394f
--- /dev/null
+++ b/test/completion/genaliases.exp
@@ -0,0 +1 @@
+assert_source_completions genaliases
diff --git a/test/completion/getent.exp b/test/completion/getent.exp
new file mode 100644
index 00000000..9abcfbbd
--- /dev/null
+++ b/test/completion/getent.exp
@@ -0,0 +1 @@
+assert_source_completions getent
diff --git a/test/completion/gkrellm.exp b/test/completion/gkrellm.exp
new file mode 100644
index 00000000..55422a0f
--- /dev/null
+++ b/test/completion/gkrellm.exp
@@ -0,0 +1 @@
+assert_source_completions gkrellm
diff --git a/test/completion/gmplayer.exp b/test/completion/gmplayer.exp
new file mode 100644
index 00000000..0cea91c1
--- /dev/null
+++ b/test/completion/gmplayer.exp
@@ -0,0 +1 @@
+assert_source_completions gmplayer
diff --git a/test/completion/gnatmake.exp b/test/completion/gnatmake.exp
new file mode 100644
index 00000000..eebb3c00
--- /dev/null
+++ b/test/completion/gnatmake.exp
@@ -0,0 +1 @@
+assert_source_completions gnatmake
diff --git a/test/completion/gpc.exp b/test/completion/gpc.exp
new file mode 100644
index 00000000..d7fdb9e7
--- /dev/null
+++ b/test/completion/gpc.exp
@@ -0,0 +1 @@
+assert_source_completions gpc
diff --git a/test/completion/gperf.exp b/test/completion/gperf.exp
new file mode 100644
index 00000000..2b87d664
--- /dev/null
+++ b/test/completion/gperf.exp
@@ -0,0 +1 @@
+assert_source_completions gperf
diff --git a/test/completion/gpg.exp b/test/completion/gpg.exp
new file mode 100644
index 00000000..694f5f87
--- /dev/null
+++ b/test/completion/gpg.exp
@@ -0,0 +1 @@
+assert_source_completions gpg
diff --git a/test/completion/gprof.exp b/test/completion/gprof.exp
new file mode 100644
index 00000000..c63cc28b
--- /dev/null
+++ b/test/completion/gprof.exp
@@ -0,0 +1 @@
+assert_source_completions gprof
diff --git a/test/completion/grep.exp b/test/completion/grep.exp
new file mode 100644
index 00000000..945c3459
--- /dev/null
+++ b/test/completion/grep.exp
@@ -0,0 +1 @@
+assert_source_completions grep
diff --git a/test/completion/grub.exp b/test/completion/grub.exp
new file mode 100644
index 00000000..d50bf754
--- /dev/null
+++ b/test/completion/grub.exp
@@ -0,0 +1 @@
+assert_source_completions grub
diff --git a/test/completion/gzip.exp b/test/completion/gzip.exp
new file mode 100644
index 00000000..e2a31c5f
--- /dev/null
+++ b/test/completion/gzip.exp
@@ -0,0 +1 @@
+assert_source_completions gzip
diff --git a/test/completion/hcitool.exp b/test/completion/hcitool.exp
new file mode 100644
index 00000000..d30c564b
--- /dev/null
+++ b/test/completion/hcitool.exp
@@ -0,0 +1 @@
+assert_source_completions hcitool
diff --git a/test/completion/head.exp b/test/completion/head.exp
new file mode 100644
index 00000000..49235c2e
--- /dev/null
+++ b/test/completion/head.exp
@@ -0,0 +1 @@
+assert_source_completions head
diff --git a/test/completion/iconv.exp b/test/completion/iconv.exp
new file mode 100644
index 00000000..c4c5fb6f
--- /dev/null
+++ b/test/completion/iconv.exp
@@ -0,0 +1 @@
+assert_source_completions iconv
diff --git a/test/completion/id.exp b/test/completion/id.exp
new file mode 100644
index 00000000..a4f81c84
--- /dev/null
+++ b/test/completion/id.exp
@@ -0,0 +1 @@
+assert_source_completions id
diff --git a/test/completion/identify.exp b/test/completion/identify.exp
new file mode 100644
index 00000000..59bd9d6a
--- /dev/null
+++ b/test/completion/identify.exp
@@ -0,0 +1 @@
+assert_source_completions identify
diff --git a/test/completion/ifdown.exp b/test/completion/ifdown.exp
new file mode 100644
index 00000000..f3f1a69d
--- /dev/null
+++ b/test/completion/ifdown.exp
@@ -0,0 +1 @@
+assert_source_completions ifdown
diff --git a/test/completion/ifup.exp b/test/completion/ifup.exp
new file mode 100644
index 00000000..780794b2
--- /dev/null
+++ b/test/completion/ifup.exp
@@ -0,0 +1 @@
+assert_source_completions ifup
diff --git a/test/completion/indent.exp b/test/completion/indent.exp
new file mode 100644
index 00000000..91eae727
--- /dev/null
+++ b/test/completion/indent.exp
@@ -0,0 +1 @@
+assert_source_completions indent
diff --git a/test/completion/info.exp b/test/completion/info.exp
new file mode 100644
index 00000000..d16830b7
--- /dev/null
+++ b/test/completion/info.exp
@@ -0,0 +1 @@
+assert_source_completions info
diff --git a/test/completion/inject.exp b/test/completion/inject.exp
new file mode 100644
index 00000000..c2a18a46
--- /dev/null
+++ b/test/completion/inject.exp
@@ -0,0 +1 @@
+assert_source_completions inject
diff --git a/test/completion/insmod.exp b/test/completion/insmod.exp
new file mode 100644
index 00000000..9aab37c8
--- /dev/null
+++ b/test/completion/insmod.exp
@@ -0,0 +1 @@
+assert_source_completions insmod
diff --git a/test/completion/invoke-rc.d.exp b/test/completion/invoke-rc.d.exp
new file mode 100644
index 00000000..0198d100
--- /dev/null
+++ b/test/completion/invoke-rc.d.exp
@@ -0,0 +1 @@
+assert_source_completions invoke-rc.d
diff --git a/test/completion/ipsec.exp b/test/completion/ipsec.exp
new file mode 100644
index 00000000..f904429b
--- /dev/null
+++ b/test/completion/ipsec.exp
@@ -0,0 +1 @@
+assert_source_completions ipsec
diff --git a/test/completion/ipv6calc.exp b/test/completion/ipv6calc.exp
new file mode 100644
index 00000000..b1c3c181
--- /dev/null
+++ b/test/completion/ipv6calc.exp
@@ -0,0 +1 @@
+assert_source_completions ipv6calc
diff --git a/test/completion/irb.exp b/test/completion/irb.exp
new file mode 100644
index 00000000..02f166f8
--- /dev/null
+++ b/test/completion/irb.exp
@@ -0,0 +1 @@
+assert_source_completions irb
diff --git a/test/completion/isql.exp b/test/completion/isql.exp
new file mode 100644
index 00000000..d06295b7
--- /dev/null
+++ b/test/completion/isql.exp
@@ -0,0 +1 @@
+assert_source_completions isql
diff --git a/test/completion/iwconfig.exp b/test/completion/iwconfig.exp
new file mode 100644
index 00000000..d3935e61
--- /dev/null
+++ b/test/completion/iwconfig.exp
@@ -0,0 +1 @@
+assert_source_completions iwconfig
diff --git a/test/completion/iwlist.exp b/test/completion/iwlist.exp
new file mode 100644
index 00000000..5293e3b1
--- /dev/null
+++ b/test/completion/iwlist.exp
@@ -0,0 +1 @@
+assert_source_completions iwlist
diff --git a/test/completion/iwpriv.exp b/test/completion/iwpriv.exp
new file mode 100644
index 00000000..5caa8410
--- /dev/null
+++ b/test/completion/iwpriv.exp
@@ -0,0 +1 @@
+assert_source_completions iwpriv
diff --git a/test/completion/iwspy.exp b/test/completion/iwspy.exp
new file mode 100644
index 00000000..08476d3d
--- /dev/null
+++ b/test/completion/iwspy.exp
@@ -0,0 +1 @@
+assert_source_completions iwspy
diff --git a/test/completion/jar.exp b/test/completion/jar.exp
new file mode 100644
index 00000000..f9dbdc79
--- /dev/null
+++ b/test/completion/jar.exp
@@ -0,0 +1 @@
+assert_source_completions jar
diff --git a/test/completion/jarsigner.exp b/test/completion/jarsigner.exp
new file mode 100644
index 00000000..21b84fea
--- /dev/null
+++ b/test/completion/jarsigner.exp
@@ -0,0 +1 @@
+assert_source_completions jarsigner
diff --git a/test/completion/java.exp b/test/completion/java.exp
new file mode 100644
index 00000000..fbea3c32
--- /dev/null
+++ b/test/completion/java.exp
@@ -0,0 +1 @@
+assert_source_completions java
diff --git a/test/completion/javac.exp b/test/completion/javac.exp
new file mode 100644
index 00000000..1bc9403e
--- /dev/null
+++ b/test/completion/javac.exp
@@ -0,0 +1 @@
+assert_source_completions javac
diff --git a/test/completion/javadoc.exp b/test/completion/javadoc.exp
new file mode 100644
index 00000000..0fcca89c
--- /dev/null
+++ b/test/completion/javadoc.exp
@@ -0,0 +1 @@
+assert_source_completions javadoc
diff --git a/test/completion/k3b.exp b/test/completion/k3b.exp
new file mode 100644
index 00000000..6d71bbef
--- /dev/null
+++ b/test/completion/k3b.exp
@@ -0,0 +1 @@
+assert_source_completions k3b
diff --git a/test/completion/kdvi.exp b/test/completion/kdvi.exp
new file mode 100644
index 00000000..9f6aa664
--- /dev/null
+++ b/test/completion/kdvi.exp
@@ -0,0 +1 @@
+assert_source_completions kdvi
diff --git a/test/completion/kill.exp b/test/completion/kill.exp
new file mode 100644
index 00000000..98efb326
--- /dev/null
+++ b/test/completion/kill.exp
@@ -0,0 +1 @@
+assert_source_completions kill
diff --git a/test/completion/killall.exp b/test/completion/killall.exp
new file mode 100644
index 00000000..8cf4fe58
--- /dev/null
+++ b/test/completion/killall.exp
@@ -0,0 +1 @@
+assert_source_completions killall
diff --git a/test/completion/kldload.exp b/test/completion/kldload.exp
new file mode 100644
index 00000000..23ad008b
--- /dev/null
+++ b/test/completion/kldload.exp
@@ -0,0 +1 @@
+assert_source_completions kldload
diff --git a/test/completion/kldunload.exp b/test/completion/kldunload.exp
new file mode 100644
index 00000000..26219f20
--- /dev/null
+++ b/test/completion/kldunload.exp
@@ -0,0 +1 @@
+assert_source_completions kldunload
diff --git a/test/completion/kpdf.exp b/test/completion/kpdf.exp
new file mode 100644
index 00000000..d0a17749
--- /dev/null
+++ b/test/completion/kpdf.exp
@@ -0,0 +1 @@
+assert_source_completions kpdf
diff --git a/test/completion/kplayer.exp b/test/completion/kplayer.exp
new file mode 100644
index 00000000..0812c045
--- /dev/null
+++ b/test/completion/kplayer.exp
@@ -0,0 +1 @@
+assert_source_completions kplayer
diff --git a/test/completion/larch.exp b/test/completion/larch.exp
new file mode 100644
index 00000000..ccf332ee
--- /dev/null
+++ b/test/completion/larch.exp
@@ -0,0 +1 @@
+assert_source_completions larch
diff --git a/test/completion/ld.exp b/test/completion/ld.exp
new file mode 100644
index 00000000..fcbc43da
--- /dev/null
+++ b/test/completion/ld.exp
@@ -0,0 +1 @@
+assert_source_completions ld
diff --git a/test/completion/ldd.exp b/test/completion/ldd.exp
new file mode 100644
index 00000000..af175bef
--- /dev/null
+++ b/test/completion/ldd.exp
@@ -0,0 +1 @@
+assert_source_completions ldd
diff --git a/test/completion/less.exp b/test/completion/less.exp
new file mode 100644
index 00000000..1a18c817
--- /dev/null
+++ b/test/completion/less.exp
@@ -0,0 +1 @@
+assert_source_completions less
diff --git a/test/completion/lftp.exp b/test/completion/lftp.exp
new file mode 100644
index 00000000..90f307b8
--- /dev/null
+++ b/test/completion/lftp.exp
@@ -0,0 +1 @@
+assert_source_completions lftp
diff --git a/test/completion/lftpget.exp b/test/completion/lftpget.exp
new file mode 100644
index 00000000..26c40cb8
--- /dev/null
+++ b/test/completion/lftpget.exp
@@ -0,0 +1 @@
+assert_source_completions lftpget
diff --git a/test/completion/lilo.exp b/test/completion/lilo.exp
new file mode 100644
index 00000000..94076365
--- /dev/null
+++ b/test/completion/lilo.exp
@@ -0,0 +1 @@
+assert_source_completions lilo
diff --git a/test/completion/links.exp b/test/completion/links.exp
new file mode 100644
index 00000000..36af0ddf
--- /dev/null
+++ b/test/completion/links.exp
@@ -0,0 +1 @@
+assert_source_completions links
diff --git a/test/completion/lisp.exp b/test/completion/lisp.exp
new file mode 100644
index 00000000..f531d8e2
--- /dev/null
+++ b/test/completion/lisp.exp
@@ -0,0 +1 @@
+assert_source_completions lisp
diff --git a/test/completion/list_admins.exp b/test/completion/list_admins.exp
new file mode 100644
index 00000000..17d9f57a
--- /dev/null
+++ b/test/completion/list_admins.exp
@@ -0,0 +1 @@
+assert_source_completions list_admins
diff --git a/test/completion/list_lists.exp b/test/completion/list_lists.exp
new file mode 100644
index 00000000..28a381cd
--- /dev/null
+++ b/test/completion/list_lists.exp
@@ -0,0 +1 @@
+assert_source_completions list_lists
diff --git a/test/completion/list_members.exp b/test/completion/list_members.exp
new file mode 100644
index 00000000..89b6e1ef
--- /dev/null
+++ b/test/completion/list_members.exp
@@ -0,0 +1 @@
+assert_source_completions list_members
diff --git a/test/completion/list_owners.exp b/test/completion/list_owners.exp
new file mode 100644
index 00000000..88262b09
--- /dev/null
+++ b/test/completion/list_owners.exp
@@ -0,0 +1 @@
+assert_source_completions list_owners
diff --git a/test/completion/ln.exp b/test/completion/ln.exp
new file mode 100644
index 00000000..db4fe381
--- /dev/null
+++ b/test/completion/ln.exp
@@ -0,0 +1 @@
+assert_source_completions ln
diff --git a/test/completion/look.exp b/test/completion/look.exp
new file mode 100644
index 00000000..3a781af4
--- /dev/null
+++ b/test/completion/look.exp
@@ -0,0 +1 @@
+assert_source_completions look
diff --git a/test/completion/ls.exp b/test/completion/ls.exp
new file mode 100644
index 00000000..c98d3463
--- /dev/null
+++ b/test/completion/ls.exp
@@ -0,0 +1 @@
+assert_source_completions ls
diff --git a/test/completion/lvchange.exp b/test/completion/lvchange.exp
new file mode 100644
index 00000000..400a6c5f
--- /dev/null
+++ b/test/completion/lvchange.exp
@@ -0,0 +1 @@
+assert_source_completions lvchange
diff --git a/test/completion/lvcreate.exp b/test/completion/lvcreate.exp
new file mode 100644
index 00000000..f211c6d5
--- /dev/null
+++ b/test/completion/lvcreate.exp
@@ -0,0 +1 @@
+assert_source_completions lvcreate
diff --git a/test/completion/lvdisplay.exp b/test/completion/lvdisplay.exp
new file mode 100644
index 00000000..0d4540b3
--- /dev/null
+++ b/test/completion/lvdisplay.exp
@@ -0,0 +1 @@
+assert_source_completions lvdisplay
diff --git a/test/completion/lvextend.exp b/test/completion/lvextend.exp
new file mode 100644
index 00000000..84c1b526
--- /dev/null
+++ b/test/completion/lvextend.exp
@@ -0,0 +1 @@
+assert_source_completions lvextend
diff --git a/test/completion/lvm.exp b/test/completion/lvm.exp
new file mode 100644
index 00000000..ff3e80fd
--- /dev/null
+++ b/test/completion/lvm.exp
@@ -0,0 +1 @@
+assert_source_completions lvm
diff --git a/test/completion/lvmdiskscan.exp b/test/completion/lvmdiskscan.exp
new file mode 100644
index 00000000..c1f4f5f8
--- /dev/null
+++ b/test/completion/lvmdiskscan.exp
@@ -0,0 +1 @@
+assert_source_completions lvmdiskscan
diff --git a/test/completion/lvreduce.exp b/test/completion/lvreduce.exp
new file mode 100644
index 00000000..c9cd8732
--- /dev/null
+++ b/test/completion/lvreduce.exp
@@ -0,0 +1 @@
+assert_source_completions lvreduce
diff --git a/test/completion/lvremove.exp b/test/completion/lvremove.exp
new file mode 100644
index 00000000..475202fb
--- /dev/null
+++ b/test/completion/lvremove.exp
@@ -0,0 +1 @@
+assert_source_completions lvremove
diff --git a/test/completion/lvrename.exp b/test/completion/lvrename.exp
new file mode 100644
index 00000000..32e7f626
--- /dev/null
+++ b/test/completion/lvrename.exp
@@ -0,0 +1 @@
+assert_source_completions lvrename
diff --git a/test/completion/lvresize.exp b/test/completion/lvresize.exp
new file mode 100644
index 00000000..dd05dbdc
--- /dev/null
+++ b/test/completion/lvresize.exp
@@ -0,0 +1 @@
+assert_source_completions lvresize
diff --git a/test/completion/lvs.exp b/test/completion/lvs.exp
new file mode 100644
index 00000000..796c8b2d
--- /dev/null
+++ b/test/completion/lvs.exp
@@ -0,0 +1 @@
+assert_source_completions lvs
diff --git a/test/completion/lvscan.exp b/test/completion/lvscan.exp
new file mode 100644
index 00000000..549c9fdb
--- /dev/null
+++ b/test/completion/lvscan.exp
@@ -0,0 +1 @@
+assert_source_completions lvscan
diff --git a/test/completion/lzma.exp b/test/completion/lzma.exp
new file mode 100644
index 00000000..8d3f637b
--- /dev/null
+++ b/test/completion/lzma.exp
@@ -0,0 +1 @@
+assert_source_completions lzma
diff --git a/test/completion/lzop.exp b/test/completion/lzop.exp
new file mode 100644
index 00000000..99d8e67e
--- /dev/null
+++ b/test/completion/lzop.exp
@@ -0,0 +1 @@
+assert_source_completions lzop
diff --git a/test/completion/m4.exp b/test/completion/m4.exp
new file mode 100644
index 00000000..475fb9a9
--- /dev/null
+++ b/test/completion/m4.exp
@@ -0,0 +1 @@
+assert_source_completions m4
diff --git a/test/completion/macof.exp b/test/completion/macof.exp
new file mode 100644
index 00000000..0942c213
--- /dev/null
+++ b/test/completion/macof.exp
@@ -0,0 +1 @@
+assert_source_completions macof
diff --git a/test/completion/mailmanctl.exp b/test/completion/mailmanctl.exp
new file mode 100644
index 00000000..2784b27c
--- /dev/null
+++ b/test/completion/mailmanctl.exp
@@ -0,0 +1 @@
+assert_source_completions mailmanctl
diff --git a/test/completion/mailsnarf.exp b/test/completion/mailsnarf.exp
new file mode 100644
index 00000000..c3e20e2a
--- /dev/null
+++ b/test/completion/mailsnarf.exp
@@ -0,0 +1 @@
+assert_source_completions mailsnarf
diff --git a/test/completion/make.exp b/test/completion/make.exp
new file mode 100644
index 00000000..483c7fe8
--- /dev/null
+++ b/test/completion/make.exp
@@ -0,0 +1 @@
+assert_source_completions make
diff --git a/test/completion/man.exp b/test/completion/man.exp
new file mode 100644
index 00000000..7bae8c03
--- /dev/null
+++ b/test/completion/man.exp
@@ -0,0 +1 @@
+assert_source_completions man
diff --git a/test/completion/mc.exp b/test/completion/mc.exp
new file mode 100644
index 00000000..37471b40
--- /dev/null
+++ b/test/completion/mc.exp
@@ -0,0 +1 @@
+assert_source_completions mc
diff --git a/test/completion/mcrypt.exp b/test/completion/mcrypt.exp
new file mode 100644
index 00000000..086b0581
--- /dev/null
+++ b/test/completion/mcrypt.exp
@@ -0,0 +1 @@
+assert_source_completions mcrypt
diff --git a/test/completion/md5sum.exp b/test/completion/md5sum.exp
new file mode 100644
index 00000000..3378b370
--- /dev/null
+++ b/test/completion/md5sum.exp
@@ -0,0 +1 @@
+assert_source_completions md5sum
diff --git a/test/completion/mdecrypt.exp b/test/completion/mdecrypt.exp
new file mode 100644
index 00000000..daab2196
--- /dev/null
+++ b/test/completion/mdecrypt.exp
@@ -0,0 +1 @@
+assert_source_completions mdecrypt
diff --git a/test/completion/mencoder.exp b/test/completion/mencoder.exp
new file mode 100644
index 00000000..6c4fa23d
--- /dev/null
+++ b/test/completion/mencoder.exp
@@ -0,0 +1 @@
+assert_source_completions mencoder
diff --git a/test/completion/minicom.exp b/test/completion/minicom.exp
new file mode 100644
index 00000000..cef598e9
--- /dev/null
+++ b/test/completion/minicom.exp
@@ -0,0 +1 @@
+assert_source_completions minicom
diff --git a/test/completion/mkdir.exp b/test/completion/mkdir.exp
new file mode 100644
index 00000000..f4bad3b9
--- /dev/null
+++ b/test/completion/mkdir.exp
@@ -0,0 +1 @@
+assert_source_completions mkdir
diff --git a/test/completion/mkfifo.exp b/test/completion/mkfifo.exp
new file mode 100644
index 00000000..706b36f4
--- /dev/null
+++ b/test/completion/mkfifo.exp
@@ -0,0 +1 @@
+assert_source_completions mkfifo
diff --git a/test/completion/mkinitrd.exp b/test/completion/mkinitrd.exp
new file mode 100644
index 00000000..e8f4e119
--- /dev/null
+++ b/test/completion/mkinitrd.exp
@@ -0,0 +1 @@
+assert_source_completions mkinitrd
diff --git a/test/completion/mkisofs.exp b/test/completion/mkisofs.exp
new file mode 100644
index 00000000..a94d833b
--- /dev/null
+++ b/test/completion/mkisofs.exp
@@ -0,0 +1 @@
+assert_source_completions mkisofs
diff --git a/test/completion/mknod.exp b/test/completion/mknod.exp
new file mode 100644
index 00000000..89f0cefd
--- /dev/null
+++ b/test/completion/mknod.exp
@@ -0,0 +1 @@
+assert_source_completions mknod
diff --git a/test/completion/mmsitepass.exp b/test/completion/mmsitepass.exp
new file mode 100644
index 00000000..c54c53b2
--- /dev/null
+++ b/test/completion/mmsitepass.exp
@@ -0,0 +1 @@
+assert_source_completions mmsitepass
diff --git a/test/completion/module.exp b/test/completion/module.exp
new file mode 100644
index 00000000..3db6d110
--- /dev/null
+++ b/test/completion/module.exp
@@ -0,0 +1 @@
+assert_source_completions module
diff --git a/test/completion/mogrify.exp b/test/completion/mogrify.exp
new file mode 100644
index 00000000..ad3ff02a
--- /dev/null
+++ b/test/completion/mogrify.exp
@@ -0,0 +1 @@
+assert_source_completions mogrify
diff --git a/test/completion/montage.exp b/test/completion/montage.exp
new file mode 100644
index 00000000..afb11ad5
--- /dev/null
+++ b/test/completion/montage.exp
@@ -0,0 +1 @@
+assert_source_completions montage
diff --git a/test/completion/mount.exp b/test/completion/mount.exp
new file mode 100644
index 00000000..2561e20a
--- /dev/null
+++ b/test/completion/mount.exp
@@ -0,0 +1 @@
+assert_source_completions mount
diff --git a/test/completion/mplayer.exp b/test/completion/mplayer.exp
new file mode 100644
index 00000000..5c38af87
--- /dev/null
+++ b/test/completion/mplayer.exp
@@ -0,0 +1 @@
+assert_source_completions mplayer
diff --git a/test/completion/msgsnarf.exp b/test/completion/msgsnarf.exp
new file mode 100644
index 00000000..cdcbf43d
--- /dev/null
+++ b/test/completion/msgsnarf.exp
@@ -0,0 +1 @@
+assert_source_completions msgsnarf
diff --git a/test/completion/mtx.exp b/test/completion/mtx.exp
new file mode 100644
index 00000000..6be7a2ff
--- /dev/null
+++ b/test/completion/mtx.exp
@@ -0,0 +1 @@
+assert_source_completions mtx
diff --git a/test/completion/mutt.exp b/test/completion/mutt.exp
new file mode 100644
index 00000000..5fb8c339
--- /dev/null
+++ b/test/completion/mutt.exp
@@ -0,0 +1 @@
+assert_source_completions mutt
diff --git a/test/completion/muttng.exp b/test/completion/muttng.exp
new file mode 100644
index 00000000..b06b574d
--- /dev/null
+++ b/test/completion/muttng.exp
@@ -0,0 +1 @@
+assert_source_completions muttng
diff --git a/test/completion/mv.exp b/test/completion/mv.exp
new file mode 100644
index 00000000..b7d22766
--- /dev/null
+++ b/test/completion/mv.exp
@@ -0,0 +1 @@
+assert_source_completions mv
diff --git a/test/completion/mysqladmin.exp b/test/completion/mysqladmin.exp
new file mode 100644
index 00000000..61769d26
--- /dev/null
+++ b/test/completion/mysqladmin.exp
@@ -0,0 +1 @@
+assert_source_completions mysqladmin
diff --git a/test/completion/ncftp.exp b/test/completion/ncftp.exp
new file mode 100644
index 00000000..c5db3f96
--- /dev/null
+++ b/test/completion/ncftp.exp
@@ -0,0 +1 @@
+assert_source_completions ncftp
diff --git a/test/completion/netstat.exp b/test/completion/netstat.exp
new file mode 100644
index 00000000..bee92789
--- /dev/null
+++ b/test/completion/netstat.exp
@@ -0,0 +1 @@
+assert_source_completions netstat
diff --git a/test/completion/newlist.exp b/test/completion/newlist.exp
new file mode 100644
index 00000000..ac05a92f
--- /dev/null
+++ b/test/completion/newlist.exp
@@ -0,0 +1 @@
+assert_source_completions newlist
diff --git a/test/completion/nl.exp b/test/completion/nl.exp
new file mode 100644
index 00000000..c788a06b
--- /dev/null
+++ b/test/completion/nl.exp
@@ -0,0 +1 @@
+assert_source_completions nl
diff --git a/test/completion/nm.exp b/test/completion/nm.exp
new file mode 100644
index 00000000..99ccd370
--- /dev/null
+++ b/test/completion/nm.exp
@@ -0,0 +1 @@
+assert_source_completions nm
diff --git a/test/completion/ntpdate.exp b/test/completion/ntpdate.exp
new file mode 100644
index 00000000..d40bbd73
--- /dev/null
+++ b/test/completion/ntpdate.exp
@@ -0,0 +1 @@
+assert_source_completions ntpdate
diff --git a/test/completion/objcopy.exp b/test/completion/objcopy.exp
new file mode 100644
index 00000000..579d9ba9
--- /dev/null
+++ b/test/completion/objcopy.exp
@@ -0,0 +1 @@
+assert_source_completions objcopy
diff --git a/test/completion/objdump.exp b/test/completion/objdump.exp
new file mode 100644
index 00000000..78689842
--- /dev/null
+++ b/test/completion/objdump.exp
@@ -0,0 +1 @@
+assert_source_completions objdump
diff --git a/test/completion/od.exp b/test/completion/od.exp
new file mode 100644
index 00000000..e9ec0f8f
--- /dev/null
+++ b/test/completion/od.exp
@@ -0,0 +1 @@
+assert_source_completions od
diff --git a/test/completion/openssl.exp b/test/completion/openssl.exp
new file mode 100644
index 00000000..281cbf9c
--- /dev/null
+++ b/test/completion/openssl.exp
@@ -0,0 +1 @@
+assert_source_completions openssl
diff --git a/test/completion/p4.exp b/test/completion/p4.exp
new file mode 100644
index 00000000..9301a04b
--- /dev/null
+++ b/test/completion/p4.exp
@@ -0,0 +1 @@
+assert_source_completions p4
diff --git a/test/completion/pack200.exp b/test/completion/pack200.exp
new file mode 100644
index 00000000..b20f8178
--- /dev/null
+++ b/test/completion/pack200.exp
@@ -0,0 +1 @@
+assert_source_completions pack200
diff --git a/test/completion/paste.exp b/test/completion/paste.exp
new file mode 100644
index 00000000..ab2f1249
--- /dev/null
+++ b/test/completion/paste.exp
@@ -0,0 +1 @@
+assert_source_completions paste
diff --git a/test/completion/patch.exp b/test/completion/patch.exp
new file mode 100644
index 00000000..27d69363
--- /dev/null
+++ b/test/completion/patch.exp
@@ -0,0 +1 @@
+assert_source_completions patch
diff --git a/test/completion/perl.exp b/test/completion/perl.exp
new file mode 100644
index 00000000..617a7b18
--- /dev/null
+++ b/test/completion/perl.exp
@@ -0,0 +1 @@
+assert_source_completions perl
diff --git a/test/completion/perldoc.exp b/test/completion/perldoc.exp
new file mode 100644
index 00000000..d0d49b1a
--- /dev/null
+++ b/test/completion/perldoc.exp
@@ -0,0 +1 @@
+assert_source_completions perldoc
diff --git a/test/completion/pgrep.exp b/test/completion/pgrep.exp
new file mode 100644
index 00000000..6deac165
--- /dev/null
+++ b/test/completion/pgrep.exp
@@ -0,0 +1 @@
+assert_source_completions pgrep
diff --git a/test/completion/pine.exp b/test/completion/pine.exp
new file mode 100644
index 00000000..635d79b9
--- /dev/null
+++ b/test/completion/pine.exp
@@ -0,0 +1 @@
+assert_source_completions pine
diff --git a/test/completion/ping.exp b/test/completion/ping.exp
new file mode 100644
index 00000000..f006ea25
--- /dev/null
+++ b/test/completion/ping.exp
@@ -0,0 +1 @@
+assert_source_completions ping
diff --git a/test/completion/pkg-config.exp b/test/completion/pkg-config.exp
new file mode 100644
index 00000000..03d8dc41
--- /dev/null
+++ b/test/completion/pkg-config.exp
@@ -0,0 +1 @@
+assert_source_completions pkg-config
diff --git a/test/completion/pkg_deinstall.exp b/test/completion/pkg_deinstall.exp
new file mode 100644
index 00000000..e7a666cd
--- /dev/null
+++ b/test/completion/pkg_deinstall.exp
@@ -0,0 +1 @@
+assert_source_completions pkg_deinstall
diff --git a/test/completion/pkg_delete.exp b/test/completion/pkg_delete.exp
new file mode 100644
index 00000000..f66049e0
--- /dev/null
+++ b/test/completion/pkg_delete.exp
@@ -0,0 +1 @@
+assert_source_completions pkg_delete
diff --git a/test/completion/pkg_info.exp b/test/completion/pkg_info.exp
new file mode 100644
index 00000000..e5387cdb
--- /dev/null
+++ b/test/completion/pkg_info.exp
@@ -0,0 +1 @@
+assert_source_completions pkg_info
diff --git a/test/completion/pkill.exp b/test/completion/pkill.exp
new file mode 100644
index 00000000..56e30836
--- /dev/null
+++ b/test/completion/pkill.exp
@@ -0,0 +1 @@
+assert_source_completions pkill
diff --git a/test/completion/portinstall.exp b/test/completion/portinstall.exp
new file mode 100644
index 00000000..87fb5968
--- /dev/null
+++ b/test/completion/portinstall.exp
@@ -0,0 +1 @@
+assert_source_completions portinstall
diff --git a/test/completion/portupgrade.exp b/test/completion/portupgrade.exp
new file mode 100644
index 00000000..00e8d4df
--- /dev/null
+++ b/test/completion/portupgrade.exp
@@ -0,0 +1 @@
+assert_source_completions portupgrade
diff --git a/test/completion/povray.exp b/test/completion/povray.exp
new file mode 100644
index 00000000..4d49702f
--- /dev/null
+++ b/test/completion/povray.exp
@@ -0,0 +1 @@
+assert_source_completions povray
diff --git a/test/completion/pr.exp b/test/completion/pr.exp
new file mode 100644
index 00000000..940bfe40
--- /dev/null
+++ b/test/completion/pr.exp
@@ -0,0 +1 @@
+assert_source_completions pr
diff --git a/test/completion/psql.exp b/test/completion/psql.exp
new file mode 100644
index 00000000..619d9e13
--- /dev/null
+++ b/test/completion/psql.exp
@@ -0,0 +1 @@
+assert_source_completions psql
diff --git a/test/completion/ptx.exp b/test/completion/ptx.exp
new file mode 100644
index 00000000..4ab752b5
--- /dev/null
+++ b/test/completion/ptx.exp
@@ -0,0 +1 @@
+assert_source_completions ptx
diff --git a/test/completion/pvchange.exp b/test/completion/pvchange.exp
new file mode 100644
index 00000000..d6f35360
--- /dev/null
+++ b/test/completion/pvchange.exp
@@ -0,0 +1 @@
+assert_source_completions pvchange
diff --git a/test/completion/pvcreate.exp b/test/completion/pvcreate.exp
new file mode 100644
index 00000000..1542baa5
--- /dev/null
+++ b/test/completion/pvcreate.exp
@@ -0,0 +1 @@
+assert_source_completions pvcreate
diff --git a/test/completion/pvdisplay.exp b/test/completion/pvdisplay.exp
new file mode 100644
index 00000000..bcbcb588
--- /dev/null
+++ b/test/completion/pvdisplay.exp
@@ -0,0 +1 @@
+assert_source_completions pvdisplay
diff --git a/test/completion/pvmove.exp b/test/completion/pvmove.exp
new file mode 100644
index 00000000..43151934
--- /dev/null
+++ b/test/completion/pvmove.exp
@@ -0,0 +1 @@
+assert_source_completions pvmove
diff --git a/test/completion/pvremove.exp b/test/completion/pvremove.exp
new file mode 100644
index 00000000..3cc59769
--- /dev/null
+++ b/test/completion/pvremove.exp
@@ -0,0 +1 @@
+assert_source_completions pvremove
diff --git a/test/completion/pvs.exp b/test/completion/pvs.exp
new file mode 100644
index 00000000..22dc03d0
--- /dev/null
+++ b/test/completion/pvs.exp
@@ -0,0 +1 @@
+assert_source_completions pvs
diff --git a/test/completion/pvscan.exp b/test/completion/pvscan.exp
new file mode 100644
index 00000000..22b02c7f
--- /dev/null
+++ b/test/completion/pvscan.exp
@@ -0,0 +1 @@
+assert_source_completions pvscan
diff --git a/test/completion/python.exp b/test/completion/python.exp
new file mode 100644
index 00000000..2cb7390d
--- /dev/null
+++ b/test/completion/python.exp
@@ -0,0 +1 @@
+assert_source_completions python
diff --git a/test/completion/qrunner.exp b/test/completion/qrunner.exp
new file mode 100644
index 00000000..567dcb4d
--- /dev/null
+++ b/test/completion/qrunner.exp
@@ -0,0 +1 @@
+assert_source_completions qrunner
diff --git a/test/completion/querybts.exp b/test/completion/querybts.exp
new file mode 100644
index 00000000..81203b2b
--- /dev/null
+++ b/test/completion/querybts.exp
@@ -0,0 +1 @@
+assert_source_completions querybts
diff --git a/test/completion/rcs.exp b/test/completion/rcs.exp
new file mode 100644
index 00000000..34b21190
--- /dev/null
+++ b/test/completion/rcs.exp
@@ -0,0 +1 @@
+assert_source_completions rcs
diff --git a/test/completion/rcsdiff.exp b/test/completion/rcsdiff.exp
new file mode 100644
index 00000000..9cf52dcc
--- /dev/null
+++ b/test/completion/rcsdiff.exp
@@ -0,0 +1 @@
+assert_source_completions rcsdiff
diff --git a/test/completion/rdict.exp b/test/completion/rdict.exp
new file mode 100644
index 00000000..cea99fbc
--- /dev/null
+++ b/test/completion/rdict.exp
@@ -0,0 +1 @@
+assert_source_completions rdict
diff --git a/test/completion/readelf.exp b/test/completion/readelf.exp
new file mode 100644
index 00000000..d0d9bc48
--- /dev/null
+++ b/test/completion/readelf.exp
@@ -0,0 +1 @@
+assert_source_completions readelf
diff --git a/test/completion/readonly.exp b/test/completion/readonly.exp
new file mode 100644
index 00000000..f35b8e7a
--- /dev/null
+++ b/test/completion/readonly.exp
@@ -0,0 +1 @@
+assert_source_completions readonly
diff --git a/test/completion/remove_members.exp b/test/completion/remove_members.exp
new file mode 100644
index 00000000..0cc71ac1
--- /dev/null
+++ b/test/completion/remove_members.exp
@@ -0,0 +1 @@
+assert_source_completions remove_members
diff --git a/test/completion/removepkg.exp b/test/completion/removepkg.exp
new file mode 100644
index 00000000..e78e01a7
--- /dev/null
+++ b/test/completion/removepkg.exp
@@ -0,0 +1 @@
+assert_source_completions removepkg
diff --git a/test/completion/renice.exp b/test/completion/renice.exp
new file mode 100644
index 00000000..e5d6c8e5
--- /dev/null
+++ b/test/completion/renice.exp
@@ -0,0 +1 @@
+assert_source_completions renice
diff --git a/test/completion/reportbug.exp b/test/completion/reportbug.exp
new file mode 100644
index 00000000..10d6cebb
--- /dev/null
+++ b/test/completion/reportbug.exp
@@ -0,0 +1 @@
+assert_source_completions reportbug
diff --git a/test/completion/ri.exp b/test/completion/ri.exp
new file mode 100644
index 00000000..f93d3409
--- /dev/null
+++ b/test/completion/ri.exp
@@ -0,0 +1 @@
+assert_source_completions ri
diff --git a/test/completion/rlog.exp b/test/completion/rlog.exp
new file mode 100644
index 00000000..9af48c09
--- /dev/null
+++ b/test/completion/rlog.exp
@@ -0,0 +1 @@
+assert_source_completions rlog
diff --git a/test/completion/rm.exp b/test/completion/rm.exp
new file mode 100644
index 00000000..6a99948b
--- /dev/null
+++ b/test/completion/rm.exp
@@ -0,0 +1 @@
+assert_source_completions rm
diff --git a/test/completion/rmdir.exp b/test/completion/rmdir.exp
new file mode 100644
index 00000000..a7435b82
--- /dev/null
+++ b/test/completion/rmdir.exp
@@ -0,0 +1 @@
+assert_source_completions rmdir
diff --git a/test/completion/rmlist.exp b/test/completion/rmlist.exp
new file mode 100644
index 00000000..ac4dd513
--- /dev/null
+++ b/test/completion/rmlist.exp
@@ -0,0 +1 @@
+assert_source_completions rmlist
diff --git a/test/completion/rpcdebug.exp b/test/completion/rpcdebug.exp
new file mode 100644
index 00000000..add86388
--- /dev/null
+++ b/test/completion/rpcdebug.exp
@@ -0,0 +1 @@
+assert_source_completions rpcdebug
diff --git a/test/completion/rpm.exp b/test/completion/rpm.exp
new file mode 100644
index 00000000..c583e56c
--- /dev/null
+++ b/test/completion/rpm.exp
@@ -0,0 +1 @@
+assert_source_completions rpm
diff --git a/test/completion/rsync.exp b/test/completion/rsync.exp
new file mode 100644
index 00000000..d927b509
--- /dev/null
+++ b/test/completion/rsync.exp
@@ -0,0 +1 @@
+assert_source_completions rsync
diff --git a/test/completion/rtcwake.exp b/test/completion/rtcwake.exp
new file mode 100644
index 00000000..abedd8de
--- /dev/null
+++ b/test/completion/rtcwake.exp
@@ -0,0 +1 @@
+assert_source_completions rtcwake
diff --git a/test/completion/sbcl-mt.exp b/test/completion/sbcl-mt.exp
new file mode 100644
index 00000000..a5485f14
--- /dev/null
+++ b/test/completion/sbcl-mt.exp
@@ -0,0 +1 @@
+assert_source_completions sbcl-mt
diff --git a/test/completion/sbcl.exp b/test/completion/sbcl.exp
new file mode 100644
index 00000000..865f9509
--- /dev/null
+++ b/test/completion/sbcl.exp
@@ -0,0 +1 @@
+assert_source_completions sbcl
diff --git a/test/completion/scp.exp b/test/completion/scp.exp
new file mode 100644
index 00000000..e025a9dd
--- /dev/null
+++ b/test/completion/scp.exp
@@ -0,0 +1 @@
+assert_source_completions scp
diff --git a/test/completion/screen.exp b/test/completion/screen.exp
new file mode 100644
index 00000000..8fce61d0
--- /dev/null
+++ b/test/completion/screen.exp
@@ -0,0 +1 @@
+assert_source_completions screen
diff --git a/test/completion/sed.exp b/test/completion/sed.exp
new file mode 100644
index 00000000..e4ce16f8
--- /dev/null
+++ b/test/completion/sed.exp
@@ -0,0 +1 @@
+assert_source_completions sed
diff --git a/test/completion/seq.exp b/test/completion/seq.exp
new file mode 100644
index 00000000..4123ba9d
--- /dev/null
+++ b/test/completion/seq.exp
@@ -0,0 +1 @@
+assert_source_completions seq
diff --git a/test/completion/service.exp b/test/completion/service.exp
new file mode 100644
index 00000000..a1bae6a4
--- /dev/null
+++ b/test/completion/service.exp
@@ -0,0 +1 @@
+assert_source_completions service
diff --git a/test/completion/set.exp b/test/completion/set.exp
new file mode 100644
index 00000000..e30a9c6f
--- /dev/null
+++ b/test/completion/set.exp
@@ -0,0 +1 @@
+assert_source_completions set
diff --git a/test/completion/sftp.exp b/test/completion/sftp.exp
new file mode 100644
index 00000000..448cd218
--- /dev/null
+++ b/test/completion/sftp.exp
@@ -0,0 +1 @@
+assert_source_completions sftp
diff --git a/test/completion/sha1sum.exp b/test/completion/sha1sum.exp
new file mode 100644
index 00000000..b6d09e88
--- /dev/null
+++ b/test/completion/sha1sum.exp
@@ -0,0 +1 @@
+assert_source_completions sha1sum
diff --git a/test/completion/shar.exp b/test/completion/shar.exp
new file mode 100644
index 00000000..ae23e49e
--- /dev/null
+++ b/test/completion/shar.exp
@@ -0,0 +1 @@
+assert_source_completions shar
diff --git a/test/completion/sitecopy.exp b/test/completion/sitecopy.exp
new file mode 100644
index 00000000..ddb57024
--- /dev/null
+++ b/test/completion/sitecopy.exp
@@ -0,0 +1 @@
+assert_source_completions sitecopy
diff --git a/test/completion/smartctl.exp b/test/completion/smartctl.exp
new file mode 100644
index 00000000..1b6f55d6
--- /dev/null
+++ b/test/completion/smartctl.exp
@@ -0,0 +1 @@
+assert_source_completions smartctl
diff --git a/test/completion/snownews.exp b/test/completion/snownews.exp
new file mode 100644
index 00000000..c7a94d2f
--- /dev/null
+++ b/test/completion/snownews.exp
@@ -0,0 +1 @@
+assert_source_completions snownews
diff --git a/test/completion/sort.exp b/test/completion/sort.exp
new file mode 100644
index 00000000..8cc2429e
--- /dev/null
+++ b/test/completion/sort.exp
@@ -0,0 +1 @@
+assert_source_completions sort
diff --git a/test/completion/split.exp b/test/completion/split.exp
new file mode 100644
index 00000000..78614669
--- /dev/null
+++ b/test/completion/split.exp
@@ -0,0 +1 @@
+assert_source_completions split
diff --git a/test/completion/spovray.exp b/test/completion/spovray.exp
new file mode 100644
index 00000000..3c45889b
--- /dev/null
+++ b/test/completion/spovray.exp
@@ -0,0 +1 @@
+assert_source_completions spovray
diff --git a/test/completion/ssh.exp b/test/completion/ssh.exp
new file mode 100644
index 00000000..0477cba5
--- /dev/null
+++ b/test/completion/ssh.exp
@@ -0,0 +1 @@
+assert_source_completions ssh
diff --git a/test/completion/sshmitm.exp b/test/completion/sshmitm.exp
new file mode 100644
index 00000000..f1c10baa
--- /dev/null
+++ b/test/completion/sshmitm.exp
@@ -0,0 +1 @@
+assert_source_completions sshmitm
diff --git a/test/completion/sshow.exp b/test/completion/sshow.exp
new file mode 100644
index 00000000..8899f907
--- /dev/null
+++ b/test/completion/sshow.exp
@@ -0,0 +1 @@
+assert_source_completions sshow
diff --git a/test/completion/strace.exp b/test/completion/strace.exp
new file mode 100644
index 00000000..717db3a3
--- /dev/null
+++ b/test/completion/strace.exp
@@ -0,0 +1 @@
+assert_source_completions strace
diff --git a/test/completion/strip.exp b/test/completion/strip.exp
new file mode 100644
index 00000000..d56fdb21
--- /dev/null
+++ b/test/completion/strip.exp
@@ -0,0 +1 @@
+assert_source_completions strip
diff --git a/test/completion/sudo.exp b/test/completion/sudo.exp
new file mode 100644
index 00000000..2a8015ff
--- /dev/null
+++ b/test/completion/sudo.exp
@@ -0,0 +1 @@
+assert_source_completions sudo
diff --git a/test/completion/svk.exp b/test/completion/svk.exp
new file mode 100644
index 00000000..f3b5c4e6
--- /dev/null
+++ b/test/completion/svk.exp
@@ -0,0 +1 @@
+assert_source_completions svk
diff --git a/test/completion/svn.exp b/test/completion/svn.exp
new file mode 100644
index 00000000..e68594fa
--- /dev/null
+++ b/test/completion/svn.exp
@@ -0,0 +1 @@
+assert_source_completions svn
diff --git a/test/completion/svnadmin.exp b/test/completion/svnadmin.exp
new file mode 100644
index 00000000..cbbc0b71
--- /dev/null
+++ b/test/completion/svnadmin.exp
@@ -0,0 +1 @@
+assert_source_completions svnadmin
diff --git a/test/completion/svnlook.exp b/test/completion/svnlook.exp
new file mode 100644
index 00000000..6f973fc3
--- /dev/null
+++ b/test/completion/svnlook.exp
@@ -0,0 +1 @@
+assert_source_completions svnlook
diff --git a/test/completion/sync_members.exp b/test/completion/sync_members.exp
new file mode 100644
index 00000000..85f2f8c8
--- /dev/null
+++ b/test/completion/sync_members.exp
@@ -0,0 +1 @@
+assert_source_completions sync_members
diff --git a/test/completion/sysctl.exp b/test/completion/sysctl.exp
new file mode 100644
index 00000000..cad11393
--- /dev/null
+++ b/test/completion/sysctl.exp
@@ -0,0 +1 @@
+assert_source_completions sysctl
diff --git a/test/completion/tac.exp b/test/completion/tac.exp
new file mode 100644
index 00000000..98f051ed
--- /dev/null
+++ b/test/completion/tac.exp
@@ -0,0 +1 @@
+assert_source_completions tac
diff --git a/test/completion/tail.exp b/test/completion/tail.exp
new file mode 100644
index 00000000..362876a3
--- /dev/null
+++ b/test/completion/tail.exp
@@ -0,0 +1 @@
+assert_source_completions tail
diff --git a/test/completion/tar.exp b/test/completion/tar.exp
new file mode 100644
index 00000000..4a309863
--- /dev/null
+++ b/test/completion/tar.exp
@@ -0,0 +1 @@
+assert_source_completions tar
diff --git a/test/completion/tcpkill.exp b/test/completion/tcpkill.exp
new file mode 100644
index 00000000..c062cf3b
--- /dev/null
+++ b/test/completion/tcpkill.exp
@@ -0,0 +1 @@
+assert_source_completions tcpkill
diff --git a/test/completion/tcpnice.exp b/test/completion/tcpnice.exp
new file mode 100644
index 00000000..b7f14f5e
--- /dev/null
+++ b/test/completion/tcpnice.exp
@@ -0,0 +1 @@
+assert_source_completions tcpnice
diff --git a/test/completion/tee.exp b/test/completion/tee.exp
new file mode 100644
index 00000000..deb6a0d9
--- /dev/null
+++ b/test/completion/tee.exp
@@ -0,0 +1 @@
+assert_source_completions tee
diff --git a/test/completion/texindex.exp b/test/completion/texindex.exp
new file mode 100644
index 00000000..0363595f
--- /dev/null
+++ b/test/completion/texindex.exp
@@ -0,0 +1 @@
+assert_source_completions texindex
diff --git a/test/completion/tightvncviewer.exp b/test/completion/tightvncviewer.exp
new file mode 100644
index 00000000..e08b7560
--- /dev/null
+++ b/test/completion/tightvncviewer.exp
@@ -0,0 +1 @@
+assert_source_completions tightvncviewer
diff --git a/test/completion/time.exp b/test/completion/time.exp
new file mode 100644
index 00000000..fc90f521
--- /dev/null
+++ b/test/completion/time.exp
@@ -0,0 +1 @@
+assert_source_completions time
diff --git a/test/completion/touch.exp b/test/completion/touch.exp
new file mode 100644
index 00000000..212622c5
--- /dev/null
+++ b/test/completion/touch.exp
@@ -0,0 +1 @@
+assert_source_completions touch
diff --git a/test/completion/tr.exp b/test/completion/tr.exp
new file mode 100644
index 00000000..c5b3f9be
--- /dev/null
+++ b/test/completion/tr.exp
@@ -0,0 +1 @@
+assert_source_completions tr
diff --git a/test/completion/unace.exp b/test/completion/unace.exp
new file mode 100644
index 00000000..0fe2b39f
--- /dev/null
+++ b/test/completion/unace.exp
@@ -0,0 +1 @@
+assert_source_completions unace
diff --git a/test/completion/uname.exp b/test/completion/uname.exp
new file mode 100644
index 00000000..45f26569
--- /dev/null
+++ b/test/completion/uname.exp
@@ -0,0 +1 @@
+assert_source_completions uname
diff --git a/test/completion/unexpand.exp b/test/completion/unexpand.exp
new file mode 100644
index 00000000..ed11ba79
--- /dev/null
+++ b/test/completion/unexpand.exp
@@ -0,0 +1 @@
+assert_source_completions unexpand
diff --git a/test/completion/uniq.exp b/test/completion/uniq.exp
new file mode 100644
index 00000000..a1dfa4a7
--- /dev/null
+++ b/test/completion/uniq.exp
@@ -0,0 +1 @@
+assert_source_completions uniq
diff --git a/test/completion/units.exp b/test/completion/units.exp
new file mode 100644
index 00000000..5c9bfb73
--- /dev/null
+++ b/test/completion/units.exp
@@ -0,0 +1 @@
+assert_source_completions units
diff --git a/test/completion/unpack200.exp b/test/completion/unpack200.exp
new file mode 100644
index 00000000..c90d02ed
--- /dev/null
+++ b/test/completion/unpack200.exp
@@ -0,0 +1 @@
+assert_source_completions unpack200
diff --git a/test/completion/unrar.exp b/test/completion/unrar.exp
new file mode 100644
index 00000000..d9a509ee
--- /dev/null
+++ b/test/completion/unrar.exp
@@ -0,0 +1 @@
+assert_source_completions unrar
diff --git a/test/completion/unset.exp b/test/completion/unset.exp
new file mode 100644
index 00000000..8a00dbf2
--- /dev/null
+++ b/test/completion/unset.exp
@@ -0,0 +1 @@
+assert_source_completions unset
diff --git a/test/completion/unshunt.exp b/test/completion/unshunt.exp
new file mode 100644
index 00000000..fea1a7a3
--- /dev/null
+++ b/test/completion/unshunt.exp
@@ -0,0 +1 @@
+assert_source_completions unshunt
diff --git a/test/completion/update-alternatives.exp b/test/completion/update-alternatives.exp
new file mode 100644
index 00000000..ff4bc114
--- /dev/null
+++ b/test/completion/update-alternatives.exp
@@ -0,0 +1 @@
+assert_source_completions update-alternatives
diff --git a/test/completion/update-rc.d.exp b/test/completion/update-rc.d.exp
new file mode 100644
index 00000000..1becc8cc
--- /dev/null
+++ b/test/completion/update-rc.d.exp
@@ -0,0 +1 @@
+assert_source_completions update-rc.d
diff --git a/test/completion/urlsnarf.exp b/test/completion/urlsnarf.exp
new file mode 100644
index 00000000..c541391b
--- /dev/null
+++ b/test/completion/urlsnarf.exp
@@ -0,0 +1 @@
+assert_source_completions urlsnarf
diff --git a/test/completion/vdir.exp b/test/completion/vdir.exp
new file mode 100644
index 00000000..582f3b09
--- /dev/null
+++ b/test/completion/vdir.exp
@@ -0,0 +1 @@
+assert_source_completions vdir
diff --git a/test/completion/vgcfgbackup.exp b/test/completion/vgcfgbackup.exp
new file mode 100644
index 00000000..d512f0bd
--- /dev/null
+++ b/test/completion/vgcfgbackup.exp
@@ -0,0 +1 @@
+assert_source_completions vgcfgbackup
diff --git a/test/completion/vgcfgrestore.exp b/test/completion/vgcfgrestore.exp
new file mode 100644
index 00000000..75319983
--- /dev/null
+++ b/test/completion/vgcfgrestore.exp
@@ -0,0 +1 @@
+assert_source_completions vgcfgrestore
diff --git a/test/completion/vgchange.exp b/test/completion/vgchange.exp
new file mode 100644
index 00000000..80c35c63
--- /dev/null
+++ b/test/completion/vgchange.exp
@@ -0,0 +1 @@
+assert_source_completions vgchange
diff --git a/test/completion/vgck.exp b/test/completion/vgck.exp
new file mode 100644
index 00000000..06a0829e
--- /dev/null
+++ b/test/completion/vgck.exp
@@ -0,0 +1 @@
+assert_source_completions vgck
diff --git a/test/completion/vgconvert.exp b/test/completion/vgconvert.exp
new file mode 100644
index 00000000..374522e2
--- /dev/null
+++ b/test/completion/vgconvert.exp
@@ -0,0 +1 @@
+assert_source_completions vgconvert
diff --git a/test/completion/vgcreate.exp b/test/completion/vgcreate.exp
new file mode 100644
index 00000000..11c38703
--- /dev/null
+++ b/test/completion/vgcreate.exp
@@ -0,0 +1 @@
+assert_source_completions vgcreate
diff --git a/test/completion/vgdisplay.exp b/test/completion/vgdisplay.exp
new file mode 100644
index 00000000..0f8653cd
--- /dev/null
+++ b/test/completion/vgdisplay.exp
@@ -0,0 +1 @@
+assert_source_completions vgdisplay
diff --git a/test/completion/vgexport.exp b/test/completion/vgexport.exp
new file mode 100644
index 00000000..13f10342
--- /dev/null
+++ b/test/completion/vgexport.exp
@@ -0,0 +1 @@
+assert_source_completions vgexport
diff --git a/test/completion/vgextend.exp b/test/completion/vgextend.exp
new file mode 100644
index 00000000..4b860708
--- /dev/null
+++ b/test/completion/vgextend.exp
@@ -0,0 +1 @@
+assert_source_completions vgextend
diff --git a/test/completion/vgimport.exp b/test/completion/vgimport.exp
new file mode 100644
index 00000000..dd45bfd0
--- /dev/null
+++ b/test/completion/vgimport.exp
@@ -0,0 +1 @@
+assert_source_completions vgimport
diff --git a/test/completion/vgmerge.exp b/test/completion/vgmerge.exp
new file mode 100644
index 00000000..50556060
--- /dev/null
+++ b/test/completion/vgmerge.exp
@@ -0,0 +1 @@
+assert_source_completions vgmerge
diff --git a/test/completion/vgmknodes.exp b/test/completion/vgmknodes.exp
new file mode 100644
index 00000000..74f13cb3
--- /dev/null
+++ b/test/completion/vgmknodes.exp
@@ -0,0 +1 @@
+assert_source_completions vgmknodes
diff --git a/test/completion/vgreduce.exp b/test/completion/vgreduce.exp
new file mode 100644
index 00000000..47338e05
--- /dev/null
+++ b/test/completion/vgreduce.exp
@@ -0,0 +1 @@
+assert_source_completions vgreduce
diff --git a/test/completion/vgremove.exp b/test/completion/vgremove.exp
new file mode 100644
index 00000000..029ba70e
--- /dev/null
+++ b/test/completion/vgremove.exp
@@ -0,0 +1 @@
+assert_source_completions vgremove
diff --git a/test/completion/vgrename.exp b/test/completion/vgrename.exp
new file mode 100644
index 00000000..17460c3c
--- /dev/null
+++ b/test/completion/vgrename.exp
@@ -0,0 +1 @@
+assert_source_completions vgrename
diff --git a/test/completion/vgs.exp b/test/completion/vgs.exp
new file mode 100644
index 00000000..470b8ecd
--- /dev/null
+++ b/test/completion/vgs.exp
@@ -0,0 +1 @@
+assert_source_completions vgs
diff --git a/test/completion/vgscan.exp b/test/completion/vgscan.exp
new file mode 100644
index 00000000..a8f1ce46
--- /dev/null
+++ b/test/completion/vgscan.exp
@@ -0,0 +1 @@
+assert_source_completions vgscan
diff --git a/test/completion/vgsplit.exp b/test/completion/vgsplit.exp
new file mode 100644
index 00000000..d4777569
--- /dev/null
+++ b/test/completion/vgsplit.exp
@@ -0,0 +1 @@
+assert_source_completions vgsplit
diff --git a/test/completion/vncviewer.exp b/test/completion/vncviewer.exp
new file mode 100644
index 00000000..05c663d3
--- /dev/null
+++ b/test/completion/vncviewer.exp
@@ -0,0 +1 @@
+assert_source_completions vncviewer
diff --git a/test/completion/wc.exp b/test/completion/wc.exp
new file mode 100644
index 00000000..fc6a0432
--- /dev/null
+++ b/test/completion/wc.exp
@@ -0,0 +1 @@
+assert_source_completions wc
diff --git a/test/completion/webmitm.exp b/test/completion/webmitm.exp
new file mode 100644
index 00000000..73d8a2a7
--- /dev/null
+++ b/test/completion/webmitm.exp
@@ -0,0 +1 @@
+assert_source_completions webmitm
diff --git a/test/completion/wget.exp b/test/completion/wget.exp
new file mode 100644
index 00000000..0607f2e6
--- /dev/null
+++ b/test/completion/wget.exp
@@ -0,0 +1 @@
+assert_source_completions wget
diff --git a/test/completion/who.exp b/test/completion/who.exp
new file mode 100644
index 00000000..3a312a32
--- /dev/null
+++ b/test/completion/who.exp
@@ -0,0 +1 @@
+assert_source_completions who
diff --git a/test/completion/withlist.exp b/test/completion/withlist.exp
new file mode 100644
index 00000000..cfc5a546
--- /dev/null
+++ b/test/completion/withlist.exp
@@ -0,0 +1 @@
+assert_source_completions withlist
diff --git a/test/completion/wol.exp b/test/completion/wol.exp
new file mode 100644
index 00000000..2e499726
--- /dev/null
+++ b/test/completion/wol.exp
@@ -0,0 +1 @@
+assert_source_completions wol
diff --git a/test/completion/wtf.exp b/test/completion/wtf.exp
new file mode 100644
index 00000000..3e1b364c
--- /dev/null
+++ b/test/completion/wtf.exp
@@ -0,0 +1 @@
+assert_source_completions wtf
diff --git a/test/completion/wvdial.exp b/test/completion/wvdial.exp
new file mode 100644
index 00000000..46b65712
--- /dev/null
+++ b/test/completion/wvdial.exp
@@ -0,0 +1 @@
+assert_source_completions wvdial
diff --git a/test/completion/xhost.exp b/test/completion/xhost.exp
new file mode 100644
index 00000000..159782b2
--- /dev/null
+++ b/test/completion/xhost.exp
@@ -0,0 +1 @@
+assert_source_completions xhost
diff --git a/test/completion/xmllint.exp b/test/completion/xmllint.exp
new file mode 100644
index 00000000..64210c80
--- /dev/null
+++ b/test/completion/xmllint.exp
@@ -0,0 +1 @@
+assert_source_completions xmllint
diff --git a/test/completion/xmlwf.exp b/test/completion/xmlwf.exp
new file mode 100644
index 00000000..afe823b6
--- /dev/null
+++ b/test/completion/xmlwf.exp
@@ -0,0 +1 @@
+assert_source_completions xmlwf
diff --git a/test/completion/xmms.exp b/test/completion/xmms.exp
new file mode 100644
index 00000000..2ebde005
--- /dev/null
+++ b/test/completion/xmms.exp
@@ -0,0 +1 @@
+assert_source_completions xmms
diff --git a/test/completion/xpovray.exp b/test/completion/xpovray.exp
new file mode 100644
index 00000000..1ada5e03
--- /dev/null
+++ b/test/completion/xpovray.exp
@@ -0,0 +1 @@
+assert_source_completions xpovray
diff --git a/test/completion/xrandr.exp b/test/completion/xrandr.exp
new file mode 100644
index 00000000..37dcedcc
--- /dev/null
+++ b/test/completion/xrandr.exp
@@ -0,0 +1 @@
+assert_source_completions xrandr
diff --git a/test/completion/xsltproc.exp b/test/completion/xsltproc.exp
new file mode 100644
index 00000000..8729fbe1
--- /dev/null
+++ b/test/completion/xsltproc.exp
@@ -0,0 +1 @@
+assert_source_completions xsltproc
diff --git a/test/completion/xvnc4viewer.exp b/test/completion/xvnc4viewer.exp
new file mode 100644
index 00000000..0c7210bc
--- /dev/null
+++ b/test/completion/xvnc4viewer.exp
@@ -0,0 +1 @@
+assert_source_completions xvnc4viewer
diff --git a/test/completion/xz.exp b/test/completion/xz.exp
new file mode 100644
index 00000000..92a6a170
--- /dev/null
+++ b/test/completion/xz.exp
@@ -0,0 +1 @@
+assert_source_completions xz
diff --git a/test/completion/ypcat.exp b/test/completion/ypcat.exp
new file mode 100644
index 00000000..9a244c68
--- /dev/null
+++ b/test/completion/ypcat.exp
@@ -0,0 +1 @@
+assert_source_completions ypcat
diff --git a/test/completion/ypmatch.exp b/test/completion/ypmatch.exp
new file mode 100644
index 00000000..5ec094fa
--- /dev/null
+++ b/test/completion/ypmatch.exp
@@ -0,0 +1 @@
+assert_source_completions ypmatch
diff --git a/test/completion/yum-arch.exp b/test/completion/yum-arch.exp
new file mode 100644
index 00000000..95284151
--- /dev/null
+++ b/test/completion/yum-arch.exp
@@ -0,0 +1 @@
+assert_source_completions yum-arch
diff --git a/test/completion/yum.exp b/test/completion/yum.exp
new file mode 100644
index 00000000..d1b7c1f8
--- /dev/null
+++ b/test/completion/yum.exp
@@ -0,0 +1 @@
+assert_source_completions yum
diff --git a/test/config/bashrc b/test/config/bashrc
new file mode 100644
index 00000000..ddf06339
--- /dev/null
+++ b/test/config/bashrc
@@ -0,0 +1,42 @@
+# bashrc file for DejaGnu testsuite
+
+ # Use emacs key bindings
+set -o emacs
+ # Use bash strict mode
+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/@
+TESTDIR=$(pwd)
+export PS1='$(wd=$(pwd); echo ${wd#$TESTDIR}/)@'
+export PS2='> '
+ # Configure readline
+export INPUTRC=$TESTDIR/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
+ # Ensure enough columns so expect doesn't have to care about line breaks
+stty columns 150
+ # Also test completions of system administrator commands, which are
+ # installed via the same PATH expansion in `bash_completion.have()'
+export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
+
+ # Make sure default settings are in effect
+unset -v \
+ COMP_CONFIGURE_HINTS \
+ COMP_CVS_REMOTE \
+ COMP_KNOWN_HOSTS_WITH_HOSTFILE \
+ COMP_TAR_INTERNAL_PATHS
+
+ # Load bash testsuite helper functions
+. lib/library.sh
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/config/default.exp b/test/config/default.exp
new file mode 100644
index 00000000..d1c04e71
--- /dev/null
+++ b/test/config/default.exp
@@ -0,0 +1,23 @@
+ # Set default expect fallback routines
+expect_after {
+ eof {
+ if {[info exists test]} {
+ fail "$test at eof"
+ } else {
+ fail "[info level 1] at eof"
+ }; # if
+ }; # eof
+ timeout {
+ if {[info exists test]} {
+ fail "$test at timeout"
+ } else {
+ fail "[info level 1] at timeout"
+ }; # if
+ }; # timeout
+}; # expect_after()
+
+
+ # Call tool_start(), if available
+if { [info procs "${tool}_start"] != "" } {
+ ${tool}_start
+}; # if
diff --git a/test/config/inputrc b/test/config/inputrc
new file mode 100644
index 00000000..33134da6
--- /dev/null
+++ b/test/config/inputrc
@@ -0,0 +1,21 @@
+# Readline init file for DejaGnu testsuite
+# See: info readline
+
+ # Press TAB once (instead of twice) to auto-complete
+set show-all-if-ambiguous on
+ # No bell. No ^G in output
+set bell-style none
+ # Don't query user about viewing the number of possible completions
+set completion-query-items -1
+ # Display completions sorted horizontally, not vertically
+set print-completions-horizontally on
+ # Don't use pager when showing completions
+set page-completions off
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/fixtures/_filedir/a b/i b/test/fixtures/_filedir/a b/i
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/a b/i
diff --git a/test/fixtures/_filedir/a"b/d b/test/fixtures/_filedir/a"b/d
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/a"b/d
diff --git a/test/fixtures/_filedir/a$b/h b/test/fixtures/_filedir/a$b/h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/a$b/h
diff --git a/test/fixtures/_filedir/a&b/f b/test/fixtures/_filedir/a&b/f
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/a&b/f
diff --git a/test/fixtures/_filedir/a'b/c b/test/fixtures/_filedir/a'b/c
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/a'b/c
diff --git a/test/fixtures/_filedir/ab/e b/test/fixtures/_filedir/ab/e
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/ab/e
diff --git a/test/fixtures/_filedir/aé/g b/test/fixtures/_filedir/aé/g
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/aé/g
diff --git a/test/fixtures/_filedir/ext/ee.e1 b/test/fixtures/_filedir/ext/ee.e1
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/ext/ee.e1
diff --git a/test/fixtures/_filedir/ext/ff.e2 b/test/fixtures/_filedir/ext/ff.e2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/ext/ff.e2
diff --git a/test/fixtures/_filedir/ext/foo/.gitignore b/test/fixtures/_filedir/ext/foo/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/ext/foo/.gitignore
diff --git a/test/fixtures/_filedir/ext/gg.e1 b/test/fixtures/_filedir/ext/gg.e1
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/ext/gg.e1
diff --git a/test/fixtures/_filedir/ext/hh.e2 b/test/fixtures/_filedir/ext/hh.e2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/_filedir/ext/hh.e2
diff --git a/test/fixtures/_known_hosts_real/config b/test/fixtures/_known_hosts_real/config
new file mode 100644
index 00000000..77770ffe
--- /dev/null
+++ b/test/fixtures/_known_hosts_real/config
@@ -0,0 +1,6 @@
+ UserKnownHostsFile fixtures/_known_hosts_real/known_hosts
+
+ # Unindented
+Host gee jar
+ # Indented
+ Host hus # With comment
diff --git a/test/fixtures/_known_hosts_real/config_tilde b/test/fixtures/_known_hosts_real/config_tilde
new file mode 100644
index 00000000..1068e299
--- /dev/null
+++ b/test/fixtures/_known_hosts_real/config_tilde
@@ -0,0 +1,4 @@
+# With quotes and tilde
+UserKnownHostsFile "~/fixtures/_known_hosts_real/known_hosts2"
+# Without quotes, with tilde
+UserKnownHostsFile ~/fixtures/_known_hosts_real/known_hosts3
diff --git a/test/fixtures/_known_hosts_real/known_hosts b/test/fixtures/_known_hosts_real/known_hosts
new file mode 100644
index 00000000..bf39e848
--- /dev/null
+++ b/test/fixtures/_known_hosts_real/known_hosts
@@ -0,0 +1,6 @@
+|1|abc
+|1|def
+doo
+ike ssh-rsa qwerty1234/Qwerty+1234==
+jub,10.0.0.1
+kyl,100.0.0.2
diff --git a/test/fixtures/_known_hosts_real/known_hosts2 b/test/fixtures/_known_hosts_real/known_hosts2
new file mode 100644
index 00000000..f719efd4
--- /dev/null
+++ b/test/fixtures/_known_hosts_real/known_hosts2
@@ -0,0 +1 @@
+two
diff --git a/test/fixtures/_known_hosts_real/known_hosts3 b/test/fixtures/_known_hosts_real/known_hosts3
new file mode 100644
index 00000000..2bdf67ab
--- /dev/null
+++ b/test/fixtures/_known_hosts_real/known_hosts3
@@ -0,0 +1 @@
+three
diff --git a/test/fixtures/_known_hosts_real/spaced conf b/test/fixtures/_known_hosts_real/spaced conf
new file mode 100644
index 00000000..f484f0e3
--- /dev/null
+++ b/test/fixtures/_known_hosts_real/spaced conf
@@ -0,0 +1,9 @@
+
+ # Unindented
+Host gee
+ UserKnownHostsFile "fixtures/_known_hosts_real/spaced known_hosts"
+
+ # Indented
+ Host hus # With comment
+ UserKnownHostsFile "fixtures/_known_hosts_real/known_hosts2"
+
diff --git a/test/fixtures/_known_hosts_real/spaced known_hosts b/test/fixtures/_known_hosts_real/spaced known_hosts
new file mode 100644
index 00000000..d54a04d0
--- /dev/null
+++ b/test/fixtures/_known_hosts_real/spaced known_hosts
@@ -0,0 +1,4 @@
+|1|abc
+|1|def
+doo
+ike ssh-rsa qwerty1234/Qwerty+1234==
diff --git a/test/fixtures/compgen/a'b/c b/test/fixtures/compgen/a'b/c
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/compgen/a'b/c
diff --git a/test/fixtures/compgen/t1.txt b/test/fixtures/compgen/t1.txt
new file mode 100644
index 00000000..322a14d8
--- /dev/null
+++ b/test/fixtures/compgen/t1.txt
@@ -0,0 +1,121 @@
+BASH=/bin/bash
+BASH_ARGC=()
+BASH_ARGV=()
+BASH_LINENO=()
+BASH_SOURCE=()
+BASH_VERSINFO=([0]="3" [1]="2" [2]="39" [3]="1" [4]="release" [5]="i486-pc-linux-gnu")
+BASH_VERSION='3.2.39(1)-release'
+CDPL_DIRS=([0]="/home/freddy/proj")
+CDPM_DIRS=
+CDP_DIRS=([0]="/home/freddy/proj" [1]="")
+COLUMNS=130
+COMP_CACHE=/home/freddy/.bash_completion_lib.d/cache~
+COMP_DIR=/etc/bash_completion_lib
+COMP_PATH=/home/freddy/.bash_completion_lib.d:/etc/bash_completion_lib
+COMP_RESTRICT_BY_EXTENSION=0
+COMP_VERSION=bash_completion_lib-1.3.1
+DIRSTACK=()
+EDITOR=/usr/bin/vim
+EUID=1000
+GPGKEY=10A575C3
+GPG_AGENT_INFO=/tmp/gpg-Pg6JXR/S.gpg-agent:4129:1
+GPG_TTY=/dev/pts/0
+GREP_OPTIONS='--exclude '\''distrib/*'\'' --exclude tags'
+GROUPS=()
+HISTCONTROL=ignoreboth
+HISTFILE=/home/freddy/.bash_history
+HISTFILESIZE=500
+HISTIGNORE=exit
+HISTSIZE=500
+HOME=/home/freddy
+HOSTNAME=blondy
+HOSTTYPE=i486
+IFS=$' \t\n'
+LANG=en_US
+LANGUAGE=en_NL:en_US:en_GB:en
+LINES=49
+LOGNAME=freddy
+MACHTYPE=i486-pc-linux-gnu
+MAIL=/var/mail/freddy
+MAILCHECK=60
+OLDPWD=/home/freddy/.bash_completion_lib.d
+OPTERR=1
+OPTIND=1
+OSTYPE=linux-gnu
+PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/freddy/proj/rc/bin
+PIPESTATUS=([0]="0")
+PPID=29352
+PS1=$'\\[\E[0;34m\\]\\!\\[\E[0m\\]\\[\E[1;32m\\]$(stoppedjobs)\\[\E[0m\\]:\\u@\\h:\\w> \\[\E[m\\]'
+PS2='> '
+PS4='+ '
+PWD=/home/freddy/proj/bashCompletion/bash-completion.git/test/fixtures/compgen
+SHELL=/bin/bash
+SHELLOPTS=braceexpand:hashall:histexpand:interactive-comments:monitor:vi
+SHLVL=1
+SSH_AUTH_SOCK=/tmp/ssh-xhQbo29352/agent.29352
+SSH_CLIENT='192.168.123.143 37670 4822'
+SSH_CONNECTION='192.168.123.143 37670 192.168.123.8 4822'
+SSH_TTY=/dev/pts/0
+TERM=xterm
+UID=1000
+USER=freddy
+VIM=/home/freddy/.vim
+VIMRUNTIME=/usr/share/vim/vimcurrent
+_=GPG_AGENT_INFO
+bash205='3.2.39(1)-release'
+bash205b='3.2.39(1)-release'
+bash3='3.2.39(1)-release'
+cdots ()
+{
+ [ -d "$1$2" ] && cd "$1$2" || eval cd "$1$2"
+}
+comp_load ()
+{
+ local cmd=${COMP_WORDS[0]} dir globs OLDIFS=$IFS;
+ IFS=:;
+ local -a aPaths=($COMP_PATH);
+ IFS='
+';
+ globs=($(
+ for dir in "${aPaths[@]}"; do
+ echo \"$dir\"/complete\*/\*.$cmd
+ echo \"$dir\"/complete\*/$cmd\!
+ echo \"$dir\"/complete\*/$cmd
+ done
+ ));
+ IFS=$OLDIFS;
+ if ! declare -F comp_include >&/dev/null; then
+ for dir in "${aPaths[@]}";
+ do
+ [ -r "$dir/include/comp_include" ] && . "$dir/include/comp_include" && break;
+ done;
+ fi;
+ comp_include comp_load_init;
+ comp_load_init;
+ local script="$(eval find "${globs[@]}" 2> /dev/null | head -1)";
+ local link comp=${script##*/};
+ [[ ${comp: -1:1} == ! ]] || {
+ link=${comp#*.};
+ comp=${comp%.$link}
+ };
+ local path=${script%/*};
+ [ "$script" -a -r "$path/$comp" ] && . "$path/$comp" && declare -F _$comp >&/dev/null && {
+ [ ${COMP_INSTALL:-1} -eq 0 ] || _comp_install $comp "$path"
+ } && _$comp $link;
+ comp_load_deinit
+}
+nameTerminal ()
+{
+ [ "${TERM:0:5}" = "xterm" ] && local ansiNrTab=0;
+ [ "$TERM" = "rxvt" ] && local ansiNrTab=61;
+ [ "$TERM" = "konsole" ] && local ansiNrTab=30 ansiNrWindow=0;
+ [ $ansiNrTab ] && echo -n ''"]$ansiNrTab;$1"'';
+ [ $ansiNrWindow -a "$2" ] && echo -n ''"]$ansiNrWindow;$2"''
+}
+stoppedjobs ()
+{
+ if [ "$(jobs -s)" ]; then
+ echo -n "%";
+ jobs -s | wc -l;
+ fi
+}
diff --git a/test/fixtures/compgen/t2.txt b/test/fixtures/compgen/t2.txt
new file mode 100644
index 00000000..371ab2b1
--- /dev/null
+++ b/test/fixtures/compgen/t2.txt
@@ -0,0 +1,121 @@
+BASH=/bin/bash
+BASH_ARGC=()
+BASH_ARGV=()
+BASH_LINENO=()
+BASH_SOURCE=()
+BASH_VERSINFO=([0]="3" [1]="2" [2]="39" [3]="1" [4]="release" [5]="i486-pc-linux-gnu")
+BASH_VERSION='3.2.39(1)-release'
+CDPL_DIRS=([0]="/home/freddy/proj")
+CDPM_DIRS=
+CDP_DIRS=([0]="/home/freddy/proj" [1]="")
+COLUMNS=130
+COMP_CACHE=/home/freddy/.bash_completion_lib.d/cache~
+COMP_DIR=/etc/bash_completion_lib
+COMP_PATH=/home/freddy/.bash_completion_lib.d:/etc/bash_completion_lib
+COMP_RESTRICT_BY_EXTENSION=0
+COMP_VERSION=bash_completion_lib-1.3.1
+DIRSTACK=()
+EDITOR=/usr/bin/vim
+EUID=1000
+GPGKEY=10A575C3
+GPG_AGENT_INFO=/tmp/gpg-Pg6JXR/S.gpg-agent:4129:1
+GPG_TTY=/dev/pts/0
+GREP_OPTIONS='--exclude '\''distrib/*'\'' --exclude tags'
+GROUPS=()
+HISTCONTROL=ignoreboth
+HISTFILE=/home/freddy/.bash_history
+HISTFILESIZE=500
+HISTIGNORE=exit
+HISTSIZE=500
+HOME=/home/freddy
+HOSTNAME=blondy
+HOSTTYPE=i486
+IFS=$' \t\n'
+LANG=en_US
+LANGUAGE=en_NL:en_US:en_GB:en
+LINES=49
+LOGNAME=freddy
+MACHTYPE=i486-pc-linux-gnu
+MAIL=/var/mail/freddy
+MAILCHECK=60
+OLDPWD=/home/freddy/.bash_completion_lib.d
+OPTERR=1
+OPTIND=1
+OSTYPE=linux-gnu
+PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/freddy/proj/rc/bin
+PIPESTATUS=([0]="0")
+PPID=29352
+PS1=$'\\[\E[0;34m\\]\\!\\[\E[0m\\]\\[\E[1;32m\\]$(stoppedjobs)\\[\E[0m\\]:\\u@\\h:\\w> \\[\E[m\\]'
+PS2='> '
+PS4='+ '
+PWD=/home/freddy/proj/bashCompletion/bash-completion.git/test/fixtures/compgen
+SHELL=/bin/bash
+SHELLOPTS=braceexpand:hashall:histexpand:interactive-comments:monitor:vi
+SHLVL=1
+SSH_AUTH_SOCK=/tmp/ssh-xhQbo29352/agent.29352
+SSH_CLIENT='192.168.123.143 37670 4822'
+SSH_CONNECTION='192.168.123.143 37670 192.168.123.8 4822'
+SSH_TTY=/dev/pts/0
+TERM=xterm
+UID=1000
+USER=freddy
+VIM=/home/freddy/.vim
+VIMRUNTIME=/usr/share/vim/vimcurrent
+_='a\\\'\''b/'
+bash205='3.2.39(1)-release'
+bash205b='3.2.39(1)-release'
+bash3='3.2.39(1)-release'
+cdots ()
+{
+ [ -d "$1$2" ] && cd "$1$2" || eval cd "$1$2"
+}
+comp_load ()
+{
+ local cmd=${COMP_WORDS[0]} dir globs OLDIFS=$IFS;
+ IFS=:;
+ local -a aPaths=($COMP_PATH);
+ IFS='
+';
+ globs=($(
+ for dir in "${aPaths[@]}"; do
+ echo \"$dir\"/complete\*/\*.$cmd
+ echo \"$dir\"/complete\*/$cmd\!
+ echo \"$dir\"/complete\*/$cmd
+ done
+ ));
+ IFS=$OLDIFS;
+ if ! declare -F comp_include >&/dev/null; then
+ for dir in "${aPaths[@]}";
+ do
+ [ -r "$dir/include/comp_include" ] && . "$dir/include/comp_include" && break;
+ done;
+ fi;
+ comp_include comp_load_init;
+ comp_load_init;
+ local script="$(eval find "${globs[@]}" 2> /dev/null | head -1)";
+ local link comp=${script##*/};
+ [[ ${comp: -1:1} == ! ]] || {
+ link=${comp#*.};
+ comp=${comp%.$link}
+ };
+ local path=${script%/*};
+ [ "$script" -a -r "$path/$comp" ] && . "$path/$comp" && declare -F _$comp >&/dev/null && {
+ [ ${COMP_INSTALL:-1} -eq 0 ] || _comp_install $comp "$path"
+ } && _$comp $link;
+ comp_load_deinit
+}
+nameTerminal ()
+{
+ [ "${TERM:0:5}" = "xterm" ] && local ansiNrTab=0;
+ [ "$TERM" = "rxvt" ] && local ansiNrTab=61;
+ [ "$TERM" = "konsole" ] && local ansiNrTab=30 ansiNrWindow=0;
+ [ $ansiNrTab ] && echo -n ''"]$ansiNrTab;$1"'';
+ [ $ansiNrWindow -a "$2" ] && echo -n ''"]$ansiNrWindow;$2"''
+}
+stoppedjobs ()
+{
+ if [ "$(jobs -s)" ]; then
+ echo -n "%";
+ jobs -s | wc -l;
+ fi
+}
diff --git a/test/fixtures/compgen/t3.txt b/test/fixtures/compgen/t3.txt
new file mode 100644
index 00000000..371ab2b1
--- /dev/null
+++ b/test/fixtures/compgen/t3.txt
@@ -0,0 +1,121 @@
+BASH=/bin/bash
+BASH_ARGC=()
+BASH_ARGV=()
+BASH_LINENO=()
+BASH_SOURCE=()
+BASH_VERSINFO=([0]="3" [1]="2" [2]="39" [3]="1" [4]="release" [5]="i486-pc-linux-gnu")
+BASH_VERSION='3.2.39(1)-release'
+CDPL_DIRS=([0]="/home/freddy/proj")
+CDPM_DIRS=
+CDP_DIRS=([0]="/home/freddy/proj" [1]="")
+COLUMNS=130
+COMP_CACHE=/home/freddy/.bash_completion_lib.d/cache~
+COMP_DIR=/etc/bash_completion_lib
+COMP_PATH=/home/freddy/.bash_completion_lib.d:/etc/bash_completion_lib
+COMP_RESTRICT_BY_EXTENSION=0
+COMP_VERSION=bash_completion_lib-1.3.1
+DIRSTACK=()
+EDITOR=/usr/bin/vim
+EUID=1000
+GPGKEY=10A575C3
+GPG_AGENT_INFO=/tmp/gpg-Pg6JXR/S.gpg-agent:4129:1
+GPG_TTY=/dev/pts/0
+GREP_OPTIONS='--exclude '\''distrib/*'\'' --exclude tags'
+GROUPS=()
+HISTCONTROL=ignoreboth
+HISTFILE=/home/freddy/.bash_history
+HISTFILESIZE=500
+HISTIGNORE=exit
+HISTSIZE=500
+HOME=/home/freddy
+HOSTNAME=blondy
+HOSTTYPE=i486
+IFS=$' \t\n'
+LANG=en_US
+LANGUAGE=en_NL:en_US:en_GB:en
+LINES=49
+LOGNAME=freddy
+MACHTYPE=i486-pc-linux-gnu
+MAIL=/var/mail/freddy
+MAILCHECK=60
+OLDPWD=/home/freddy/.bash_completion_lib.d
+OPTERR=1
+OPTIND=1
+OSTYPE=linux-gnu
+PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/freddy/proj/rc/bin
+PIPESTATUS=([0]="0")
+PPID=29352
+PS1=$'\\[\E[0;34m\\]\\!\\[\E[0m\\]\\[\E[1;32m\\]$(stoppedjobs)\\[\E[0m\\]:\\u@\\h:\\w> \\[\E[m\\]'
+PS2='> '
+PS4='+ '
+PWD=/home/freddy/proj/bashCompletion/bash-completion.git/test/fixtures/compgen
+SHELL=/bin/bash
+SHELLOPTS=braceexpand:hashall:histexpand:interactive-comments:monitor:vi
+SHLVL=1
+SSH_AUTH_SOCK=/tmp/ssh-xhQbo29352/agent.29352
+SSH_CLIENT='192.168.123.143 37670 4822'
+SSH_CONNECTION='192.168.123.143 37670 192.168.123.8 4822'
+SSH_TTY=/dev/pts/0
+TERM=xterm
+UID=1000
+USER=freddy
+VIM=/home/freddy/.vim
+VIMRUNTIME=/usr/share/vim/vimcurrent
+_='a\\\'\''b/'
+bash205='3.2.39(1)-release'
+bash205b='3.2.39(1)-release'
+bash3='3.2.39(1)-release'
+cdots ()
+{
+ [ -d "$1$2" ] && cd "$1$2" || eval cd "$1$2"
+}
+comp_load ()
+{
+ local cmd=${COMP_WORDS[0]} dir globs OLDIFS=$IFS;
+ IFS=:;
+ local -a aPaths=($COMP_PATH);
+ IFS='
+';
+ globs=($(
+ for dir in "${aPaths[@]}"; do
+ echo \"$dir\"/complete\*/\*.$cmd
+ echo \"$dir\"/complete\*/$cmd\!
+ echo \"$dir\"/complete\*/$cmd
+ done
+ ));
+ IFS=$OLDIFS;
+ if ! declare -F comp_include >&/dev/null; then
+ for dir in "${aPaths[@]}";
+ do
+ [ -r "$dir/include/comp_include" ] && . "$dir/include/comp_include" && break;
+ done;
+ fi;
+ comp_include comp_load_init;
+ comp_load_init;
+ local script="$(eval find "${globs[@]}" 2> /dev/null | head -1)";
+ local link comp=${script##*/};
+ [[ ${comp: -1:1} == ! ]] || {
+ link=${comp#*.};
+ comp=${comp%.$link}
+ };
+ local path=${script%/*};
+ [ "$script" -a -r "$path/$comp" ] && . "$path/$comp" && declare -F _$comp >&/dev/null && {
+ [ ${COMP_INSTALL:-1} -eq 0 ] || _comp_install $comp "$path"
+ } && _$comp $link;
+ comp_load_deinit
+}
+nameTerminal ()
+{
+ [ "${TERM:0:5}" = "xterm" ] && local ansiNrTab=0;
+ [ "$TERM" = "rxvt" ] && local ansiNrTab=61;
+ [ "$TERM" = "konsole" ] && local ansiNrTab=30 ansiNrWindow=0;
+ [ $ansiNrTab ] && echo -n ''"]$ansiNrTab;$1"'';
+ [ $ansiNrWindow -a "$2" ] && echo -n ''"]$ansiNrWindow;$2"''
+}
+stoppedjobs ()
+{
+ if [ "$(jobs -s)" ]; then
+ echo -n "%";
+ jobs -s | wc -l;
+ fi
+}
diff --git a/test/fixtures/cvs/.cvspass b/test/fixtures/cvs/.cvspass
new file mode 100644
index 00000000..e7e0dce7
--- /dev/null
+++ b/test/fixtures/cvs/.cvspass
@@ -0,0 +1,2 @@
+/1 :pserver:anonymous@cvs.savannah.nongnu.org:2401/sources/cvs A
+/1 :pserver:anonymous@cvs.fedoraproject.org:2401/cvs/pkgs A
diff --git a/test/fixtures/evince/.BMP b/test/fixtures/evince/.BMP
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.BMP
diff --git a/test/fixtures/evince/.CBR b/test/fixtures/evince/.CBR
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.CBR
diff --git a/test/fixtures/evince/.CBZ b/test/fixtures/evince/.CBZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.CBZ
diff --git a/test/fixtures/evince/.DJV b/test/fixtures/evince/.DJV
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.DJV
diff --git a/test/fixtures/evince/.DJVU b/test/fixtures/evince/.DJVU
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.DJVU
diff --git a/test/fixtures/evince/.DVI b/test/fixtures/evince/.DVI
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.DVI
diff --git a/test/fixtures/evince/.DVI.BZ2 b/test/fixtures/evince/.DVI.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.DVI.BZ2
diff --git a/test/fixtures/evince/.DVI.GZ b/test/fixtures/evince/.DVI.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.DVI.GZ
diff --git a/test/fixtures/evince/.DVI.bz2 b/test/fixtures/evince/.DVI.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.DVI.bz2
diff --git a/test/fixtures/evince/.DVI.gz b/test/fixtures/evince/.DVI.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.DVI.gz
diff --git a/test/fixtures/evince/.EPS b/test/fixtures/evince/.EPS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.EPS
diff --git a/test/fixtures/evince/.EPS.BZ2 b/test/fixtures/evince/.EPS.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.EPS.BZ2
diff --git a/test/fixtures/evince/.EPS.GZ b/test/fixtures/evince/.EPS.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.EPS.GZ
diff --git a/test/fixtures/evince/.EPS.bz2 b/test/fixtures/evince/.EPS.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.EPS.bz2
diff --git a/test/fixtures/evince/.EPS.gz b/test/fixtures/evince/.EPS.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.EPS.gz
diff --git a/test/fixtures/evince/.GIF b/test/fixtures/evince/.GIF
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.GIF
diff --git a/test/fixtures/evince/.ICO b/test/fixtures/evince/.ICO
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ICO
diff --git a/test/fixtures/evince/.JPEG b/test/fixtures/evince/.JPEG
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.JPEG
diff --git a/test/fixtures/evince/.JPG b/test/fixtures/evince/.JPG
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.JPG
diff --git a/test/fixtures/evince/.MIFF b/test/fixtures/evince/.MIFF
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.MIFF
diff --git a/test/fixtures/evince/.PBM b/test/fixtures/evince/.PBM
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PBM
diff --git a/test/fixtures/evince/.PCX b/test/fixtures/evince/.PCX
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PCX
diff --git a/test/fixtures/evince/.PDF b/test/fixtures/evince/.PDF
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PDF
diff --git a/test/fixtures/evince/.PDF.BZ2 b/test/fixtures/evince/.PDF.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PDF.BZ2
diff --git a/test/fixtures/evince/.PDF.GZ b/test/fixtures/evince/.PDF.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PDF.GZ
diff --git a/test/fixtures/evince/.PDF.bz2 b/test/fixtures/evince/.PDF.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PDF.bz2
diff --git a/test/fixtures/evince/.PDF.gz b/test/fixtures/evince/.PDF.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PDF.gz
diff --git a/test/fixtures/evince/.PGM b/test/fixtures/evince/.PGM
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PGM
diff --git a/test/fixtures/evince/.PNG b/test/fixtures/evince/.PNG
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PNG
diff --git a/test/fixtures/evince/.PNM b/test/fixtures/evince/.PNM
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PNM
diff --git a/test/fixtures/evince/.PPM b/test/fixtures/evince/.PPM
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PPM
diff --git a/test/fixtures/evince/.PS b/test/fixtures/evince/.PS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PS
diff --git a/test/fixtures/evince/.PS.BZ2 b/test/fixtures/evince/.PS.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PS.BZ2
diff --git a/test/fixtures/evince/.PS.GZ b/test/fixtures/evince/.PS.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PS.GZ
diff --git a/test/fixtures/evince/.PS.bz2 b/test/fixtures/evince/.PS.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PS.bz2
diff --git a/test/fixtures/evince/.PS.gz b/test/fixtures/evince/.PS.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.PS.gz
diff --git a/test/fixtures/evince/.TGA b/test/fixtures/evince/.TGA
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.TGA
diff --git a/test/fixtures/evince/.TIF b/test/fixtures/evince/.TIF
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.TIF
diff --git a/test/fixtures/evince/.TIFF b/test/fixtures/evince/.TIFF
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.TIFF
diff --git a/test/fixtures/evince/.XPM b/test/fixtures/evince/.XPM
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.XPM
diff --git a/test/fixtures/evince/.XWD b/test/fixtures/evince/.XWD
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.XWD
diff --git a/test/fixtures/evince/.bmp b/test/fixtures/evince/.bmp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.bmp
diff --git a/test/fixtures/evince/.cbr b/test/fixtures/evince/.cbr
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.cbr
diff --git a/test/fixtures/evince/.cbz b/test/fixtures/evince/.cbz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.cbz
diff --git a/test/fixtures/evince/.djv b/test/fixtures/evince/.djv
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.djv
diff --git a/test/fixtures/evince/.djvu b/test/fixtures/evince/.djvu
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.djvu
diff --git a/test/fixtures/evince/.dvi b/test/fixtures/evince/.dvi
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.dvi
diff --git a/test/fixtures/evince/.dvi.BZ2 b/test/fixtures/evince/.dvi.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.dvi.BZ2
diff --git a/test/fixtures/evince/.dvi.GZ b/test/fixtures/evince/.dvi.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.dvi.GZ
diff --git a/test/fixtures/evince/.dvi.bz2 b/test/fixtures/evince/.dvi.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.dvi.bz2
diff --git a/test/fixtures/evince/.dvi.gz b/test/fixtures/evince/.dvi.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.dvi.gz
diff --git a/test/fixtures/evince/.eps b/test/fixtures/evince/.eps
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.eps
diff --git a/test/fixtures/evince/.eps.BZ2 b/test/fixtures/evince/.eps.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.eps.BZ2
diff --git a/test/fixtures/evince/.eps.GZ b/test/fixtures/evince/.eps.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.eps.GZ
diff --git a/test/fixtures/evince/.eps.bz2 b/test/fixtures/evince/.eps.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.eps.bz2
diff --git a/test/fixtures/evince/.eps.gz b/test/fixtures/evince/.eps.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.eps.gz
diff --git a/test/fixtures/evince/.gif b/test/fixtures/evince/.gif
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.gif
diff --git a/test/fixtures/evince/.ico b/test/fixtures/evince/.ico
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ico
diff --git a/test/fixtures/evince/.jpeg b/test/fixtures/evince/.jpeg
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.jpeg
diff --git a/test/fixtures/evince/.jpg b/test/fixtures/evince/.jpg
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.jpg
diff --git a/test/fixtures/evince/.miff b/test/fixtures/evince/.miff
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.miff
diff --git a/test/fixtures/evince/.pbm b/test/fixtures/evince/.pbm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pbm
diff --git a/test/fixtures/evince/.pcx b/test/fixtures/evince/.pcx
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pcx
diff --git a/test/fixtures/evince/.pdf b/test/fixtures/evince/.pdf
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pdf
diff --git a/test/fixtures/evince/.pdf.BZ2 b/test/fixtures/evince/.pdf.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pdf.BZ2
diff --git a/test/fixtures/evince/.pdf.GZ b/test/fixtures/evince/.pdf.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pdf.GZ
diff --git a/test/fixtures/evince/.pdf.bz2 b/test/fixtures/evince/.pdf.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pdf.bz2
diff --git a/test/fixtures/evince/.pdf.gz b/test/fixtures/evince/.pdf.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pdf.gz
diff --git a/test/fixtures/evince/.pgm b/test/fixtures/evince/.pgm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pgm
diff --git a/test/fixtures/evince/.png b/test/fixtures/evince/.png
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.png
diff --git a/test/fixtures/evince/.pnm b/test/fixtures/evince/.pnm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.pnm
diff --git a/test/fixtures/evince/.ppm b/test/fixtures/evince/.ppm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ppm
diff --git a/test/fixtures/evince/.ps b/test/fixtures/evince/.ps
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ps
diff --git a/test/fixtures/evince/.ps.BZ2 b/test/fixtures/evince/.ps.BZ2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ps.BZ2
diff --git a/test/fixtures/evince/.ps.GZ b/test/fixtures/evince/.ps.GZ
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ps.GZ
diff --git a/test/fixtures/evince/.ps.bz2 b/test/fixtures/evince/.ps.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ps.bz2
diff --git a/test/fixtures/evince/.ps.gz b/test/fixtures/evince/.ps.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.ps.gz
diff --git a/test/fixtures/evince/.tga b/test/fixtures/evince/.tga
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.tga
diff --git a/test/fixtures/evince/.tif b/test/fixtures/evince/.tif
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.tif
diff --git a/test/fixtures/evince/.tiff b/test/fixtures/evince/.tiff
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.tiff
diff --git a/test/fixtures/evince/.txt b/test/fixtures/evince/.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.txt
diff --git a/test/fixtures/evince/.xpm b/test/fixtures/evince/.xpm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.xpm
diff --git a/test/fixtures/evince/.xwd b/test/fixtures/evince/.xwd
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/.xwd
diff --git a/test/fixtures/evince/foo/.gitignore b/test/fixtures/evince/foo/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/evince/foo/.gitignore
diff --git a/test/fixtures/isql/odbc.ini b/test/fixtures/isql/odbc.ini
new file mode 100644
index 00000000..96319f3b
--- /dev/null
+++ b/test/fixtures/isql/odbc.ini
@@ -0,0 +1,3 @@
+[foo]
+
+[bar]
diff --git a/test/fixtures/java/a/b$c.class b/test/fixtures/java/a/b$c.class
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/java/a/b$c.class
diff --git a/test/fixtures/java/a/b.class b/test/fixtures/java/a/b.class
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/java/a/b.class
diff --git a/test/fixtures/java/a/c/README.txt b/test/fixtures/java/a/c/README.txt
new file mode 100644
index 00000000..e5e6d0b3
--- /dev/null
+++ b/test/fixtures/java/a/c/README.txt
@@ -0,0 +1,2 @@
+When CLASSPATH is set to the fixtures/java/a dir, we do *not* expect
+*.class in subdirs to be included in completions, see Debian bug #496828.
diff --git a/test/fixtures/java/a/c/d.class b/test/fixtures/java/a/c/d.class
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/java/a/c/d.class
diff --git a/test/fixtures/java/a/d.txt b/test/fixtures/java/a/d.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/java/a/d.txt
diff --git a/test/fixtures/java/bashcomp.jar b/test/fixtures/java/bashcomp.jar
new file mode 100644
index 00000000..d9c27799
--- /dev/null
+++ b/test/fixtures/java/bashcomp.jar
Binary files differ
diff --git a/test/fixtures/kdvi/.DVI b/test/fixtures/kdvi/.DVI
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.DVI
diff --git a/test/fixtures/kdvi/.DVI.Z b/test/fixtures/kdvi/.DVI.Z
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.DVI.Z
diff --git a/test/fixtures/kdvi/.DVI.bz2 b/test/fixtures/kdvi/.DVI.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.DVI.bz2
diff --git a/test/fixtures/kdvi/.DVI.gz b/test/fixtures/kdvi/.DVI.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.DVI.gz
diff --git a/test/fixtures/kdvi/.dvi b/test/fixtures/kdvi/.dvi
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.dvi
diff --git a/test/fixtures/kdvi/.dvi.Z b/test/fixtures/kdvi/.dvi.Z
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.dvi.Z
diff --git a/test/fixtures/kdvi/.dvi.bz2 b/test/fixtures/kdvi/.dvi.bz2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.dvi.bz2
diff --git a/test/fixtures/kdvi/.dvi.gz b/test/fixtures/kdvi/.dvi.gz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.dvi.gz
diff --git a/test/fixtures/kdvi/.txt b/test/fixtures/kdvi/.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/.txt
diff --git a/test/fixtures/kdvi/foo/.gitignore b/test/fixtures/kdvi/foo/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kdvi/foo/.gitignore
diff --git a/test/fixtures/kpdf/.EPS b/test/fixtures/kpdf/.EPS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/.EPS
diff --git a/test/fixtures/kpdf/.PDF b/test/fixtures/kpdf/.PDF
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/.PDF
diff --git a/test/fixtures/kpdf/.PS b/test/fixtures/kpdf/.PS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/.PS
diff --git a/test/fixtures/kpdf/.eps b/test/fixtures/kpdf/.eps
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/.eps
diff --git a/test/fixtures/kpdf/.pdf b/test/fixtures/kpdf/.pdf
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/.pdf
diff --git a/test/fixtures/kpdf/.ps b/test/fixtures/kpdf/.ps
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/.ps
diff --git a/test/fixtures/kpdf/.txt b/test/fixtures/kpdf/.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/.txt
diff --git a/test/fixtures/kpdf/foo/.gitignore b/test/fixtures/kpdf/foo/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/kpdf/foo/.gitignore
diff --git a/test/fixtures/lftp/.lftp/bookmarks b/test/fixtures/lftp/.lftp/bookmarks
new file mode 100644
index 00000000..31ec9303
--- /dev/null
+++ b/test/fixtures/lftp/.lftp/bookmarks
@@ -0,0 +1 @@
+lftptest ftp://ftp.funet.fi/
diff --git a/test/fixtures/mount/bin/showmount b/test/fixtures/mount/bin/showmount
new file mode 100755
index 00000000..2751c4ba
--- /dev/null
+++ b/test/fixtures/mount/bin/showmount
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ "$1" = -e ] && [ "$2" = mocksrv ]; then
+ echo "Header line"
+ echo "/test/path"
+ echo "/test/path2"
+ echo "/second/path"
+ exit 0
+fi
+
+echo "Usage: 'showmount -e mocksrv'; nothing else works."
+exit 1
diff --git a/test/fixtures/mount/test-fstab b/test/fixtures/mount/test-fstab
new file mode 100644
index 00000000..b2434173
--- /dev/null
+++ b/test/fixtures/mount/test-fstab
@@ -0,0 +1,24 @@
+proc /proc proc defaults 0 0
+none /debug debugfs defaults,noauto 0 0
+
+# Simple obvious test.
+/mnt/nice-test-path /dev/null auto ro,noauto 0 0
+
+# Test octal escapes
+# Contains ' ' and '-'
+/mnt/nice\040test\055path /dev/null auto ro,noauto 0 0
+# Contains '$' and '-'
+/mnt/nice\044test\055path /dev/null auto ro,noauto 0 0
+# Contains ' ' and '\\'
+/mnt/nice\040test\134path /dev/null auto ro,noauto 0 0
+# Contains '\n' and '\ '
+/mnt/nice\012test\040path /dev/null auto ro,noauto 0 0
+
+# Test apostrophe
+/mnt/nice'test-path /dev/null auto ro,noauto 0 0
+/mnt/other'test\040path /dev/null auto ro,noauto 0 0
+
+# Test some labels
+LABEL=Ubuntu\040Karmic /mnt/ubuntu auto no,noauto 0 0
+LABEL=Fedora /mnt/fedora auto ro,noauto 0 0
+LABEL=Debian-it's\040awesome /mnt/debian auto ro,noauto 0 0
diff --git a/test/fixtures/mutt/bar/.gitignore b/test/fixtures/mutt/bar/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/mutt/bar/.gitignore
diff --git a/test/fixtures/mutt/foo/.gitignore b/test/fixtures/mutt/foo/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/mutt/foo/.gitignore
diff --git a/test/fixtures/mutt/muttrc b/test/fixtures/mutt/muttrc
new file mode 100644
index 00000000..58ad7f55
--- /dev/null
+++ b/test/fixtures/mutt/muttrc
@@ -0,0 +1,3 @@
+set folder=.
+alias a1 a1@example.com
+alias a2 a2@example.com
diff --git a/test/fixtures/pkgtools/db/a-1.0,1/.gitignore b/test/fixtures/pkgtools/db/a-1.0,1/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/pkgtools/db/a-1.0,1/.gitignore
diff --git a/test/fixtures/pkgtools/db/b-c-d-2.0_2/.gitignore b/test/fixtures/pkgtools/db/b-c-d-2.0_2/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/pkgtools/db/b-c-d-2.0_2/.gitignore
diff --git a/test/fixtures/pkgtools/ports/.gitignore b/test/fixtures/pkgtools/ports/.gitignore
new file mode 100644
index 00000000..71d2c0c0
--- /dev/null
+++ b/test/fixtures/pkgtools/ports/.gitignore
@@ -0,0 +1,2 @@
+INDEX
+INDEX-5
diff --git a/test/fixtures/pkgtools/ports/INDEX.dist b/test/fixtures/pkgtools/ports/INDEX.dist
new file mode 100644
index 00000000..76957d4f
--- /dev/null
+++ b/test/fixtures/pkgtools/ports/INDEX.dist
@@ -0,0 +1,3 @@
+bash-3.1.17|PORTSDIR/shells/bash|/usr/local|The GNU Project's Bourne Again SHell|PORTSDIR/shells/bash/pkg-descr|obrien@FreeBSD.org|shells|expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html|||
+bash-completion-20060301_2|PORTSDIR/shells/bash-completion|/usr/local|Programmable completion library for Bash 2.04 and up|PORTSDIR/shells/bash-completion/pkg-descr|kirk@strauser.com|shells||bash-3.1.17 expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|http://www.caliban.org/bash/index.shtml|||
+bash-2.05b.007_6|PORTSDIR/shells/bash2|/usr/local|The GNU Bourne Again Shell|PORTSDIR/shells/bash2/pkg-descr|ports@FreeBSD.org|shells|||http://www.gnu.org/software/bash/|||
diff --git a/test/fixtures/scp/config b/test/fixtures/scp/config
new file mode 100644
index 00000000..fea6620e
--- /dev/null
+++ b/test/fixtures/scp/config
@@ -0,0 +1,6 @@
+UserKnownHostsFile known_hosts
+
+ # Unindented
+Host gee
+ # Indented, multiple hosts
+ HostName hus ike
diff --git a/test/fixtures/scp/known_hosts b/test/fixtures/scp/known_hosts
new file mode 100644
index 00000000..d54a04d0
--- /dev/null
+++ b/test/fixtures/scp/known_hosts
@@ -0,0 +1,4 @@
+|1|abc
+|1|def
+doo
+ike ssh-rsa qwerty1234/Qwerty+1234==
diff --git a/test/fixtures/scp/spaced conf b/test/fixtures/scp/spaced conf
new file mode 100644
index 00000000..7ad64bc8
--- /dev/null
+++ b/test/fixtures/scp/spaced conf
@@ -0,0 +1,6 @@
+ UserKnownHostsFile known_hosts
+
+ # Unindented
+Host gee jar
+ # Indented, multiple hosts
+ HostName hus
diff --git a/test/fixtures/sftp/config b/test/fixtures/sftp/config
new file mode 100644
index 00000000..fea6620e
--- /dev/null
+++ b/test/fixtures/sftp/config
@@ -0,0 +1,6 @@
+UserKnownHostsFile known_hosts
+
+ # Unindented
+Host gee
+ # Indented, multiple hosts
+ HostName hus ike
diff --git a/test/fixtures/sftp/known_hosts b/test/fixtures/sftp/known_hosts
new file mode 100644
index 00000000..d54a04d0
--- /dev/null
+++ b/test/fixtures/sftp/known_hosts
@@ -0,0 +1,4 @@
+|1|abc
+|1|def
+doo
+ike ssh-rsa qwerty1234/Qwerty+1234==
diff --git a/test/fixtures/sftp/spaced conf b/test/fixtures/sftp/spaced conf
new file mode 100644
index 00000000..7ad64bc8
--- /dev/null
+++ b/test/fixtures/sftp/spaced conf
@@ -0,0 +1,6 @@
+ UserKnownHostsFile known_hosts
+
+ # Unindented
+Host gee jar
+ # Indented, multiple hosts
+ HostName hus
diff --git a/test/fixtures/shared/bin/arp b/test/fixtures/shared/bin/arp
new file mode 100755
index 00000000..49f42960
--- /dev/null
+++ b/test/fixtures/shared/bin/arp
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Dummy "arp -an" emulator
+
+# Linux
+echo "? (0.0.0.0) at 00:00:00:00:00:00 [ether] on eth0"
+
+# FreeBSD
+echo "? (0.0.0.0) at 11:11:11:11:11:11 on bge0 expires in 5 seconds [ethernet]"
+
+# Solaris
+cat <<EOF
+Device IP Address Mask Flags Phys Addr
+------ -------------------- --------------- -------- ---------------
+ce0 0.0.0.0 255.255.255.255 o 22:22:22:22:22:22
+EOF
diff --git a/test/fixtures/shared/bin/ifconfig b/test/fixtures/shared/bin/ifconfig
new file mode 100755
index 00000000..59c9140b
--- /dev/null
+++ b/test/fixtures/shared/bin/ifconfig
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Dummy "ifconfig -a" emulator
+
+cat <<EOF
+eth0 Link encap:Ethernet HWaddr 33:33:33:33:33:33
+ inet addr:192.168.80.11 Bcast:192.168.80.255 Mask:255.255.255.0
+ inet6 addr: fe80::000:0000:0000:0000/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:855946 errors:42 dropped:0 overruns:0 frame:42
+ TX packets:477196 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:1142133425 (1.0 GiB) TX bytes:47621718 (45.4 MiB)
+ Interrupt:23 Base address:0xc000
+
+lo Link encap:Local Loopback
+ inet addr:127.0.0.1 Mask:255.0.0.0
+ inet6 addr: ::1/128 Scope:Host
+ UP LOOPBACK RUNNING MTU:16436 Metric:1
+ RX packets:129059 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:129059 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:0
+ RX bytes:7456154 (7.1 MiB) TX bytes:7456154 (7.1 MiB)
+EOF
diff --git a/test/fixtures/shared/default/bar b/test/fixtures/shared/default/bar
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/shared/default/bar
diff --git a/test/fixtures/shared/default/bar bar.d/foo b/test/fixtures/shared/default/bar bar.d/foo
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/shared/default/bar bar.d/foo
diff --git a/test/fixtures/shared/default/foo b/test/fixtures/shared/default/foo
new file mode 100644
index 00000000..257cc564
--- /dev/null
+++ b/test/fixtures/shared/default/foo
@@ -0,0 +1 @@
+foo
diff --git a/test/fixtures/shared/default/foo.d/foo b/test/fixtures/shared/default/foo.d/foo
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/shared/default/foo.d/foo
diff --git a/test/fixtures/ssh/config b/test/fixtures/ssh/config
new file mode 100644
index 00000000..806f405c
--- /dev/null
+++ b/test/fixtures/ssh/config
@@ -0,0 +1 @@
+UserKnownHostsFile known_hosts
diff --git a/test/fixtures/ssh/known_hosts b/test/fixtures/ssh/known_hosts
new file mode 100644
index 00000000..13b2f0f0
--- /dev/null
+++ b/test/fixtures/ssh/known_hosts
@@ -0,0 +1,5 @@
+|1|abc
+|1|def
+doo
+ike ssh-rsa qwerty1234/Qwerty+1234==
+ls_known_host
diff --git a/test/fixtures/ssh/spaced conf b/test/fixtures/ssh/spaced conf
new file mode 100644
index 00000000..7ad64bc8
--- /dev/null
+++ b/test/fixtures/ssh/spaced conf
@@ -0,0 +1,6 @@
+ UserKnownHostsFile known_hosts
+
+ # Unindented
+Host gee jar
+ # Indented, multiple hosts
+ HostName hus
diff --git a/test/fixtures/xz/a/b b/test/fixtures/xz/a/b
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/xz/a/b
diff --git a/test/fixtures/xz/bashcomp.lzma b/test/fixtures/xz/bashcomp.lzma
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/xz/bashcomp.lzma
diff --git a/test/fixtures/xz/bashcomp.tar b/test/fixtures/xz/bashcomp.tar
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/xz/bashcomp.tar
diff --git a/test/fixtures/xz/bashcomp.tar.xz b/test/fixtures/xz/bashcomp.tar.xz
new file mode 100644
index 00000000..b2274e64
--- /dev/null
+++ b/test/fixtures/xz/bashcomp.tar.xz
Binary files differ
diff --git a/test/fixtures/xz/bashcomp.tlz b/test/fixtures/xz/bashcomp.tlz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/xz/bashcomp.tlz
diff --git a/test/fixtures/xz/bashcomp.xz b/test/fixtures/xz/bashcomp.xz
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fixtures/xz/bashcomp.xz
diff --git a/test/lib/completion.exp b/test/lib/completion.exp
new file mode 100644
index 00000000..ea2a3d8d
--- /dev/null
+++ b/test/lib/completion.exp
@@ -0,0 +1,16 @@
+source ${srcdir}/lib/library.exp
+
+
+proc completion_exit {} {
+ send "\rexit\r"
+}
+
+
+proc completion_start {} {
+ start_interactive_test
+}
+
+
+proc completion_version {} {
+ puts "$::TESTDIR, bash-$::BASH_VERSION"
+}
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/a2ps.exp
new file mode 100644
index 00000000..796e14cc
--- /dev/null
+++ b/test/lib/completions/a2ps.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "a2ps "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/abook.exp
new file mode 100644
index 00000000..3f4e301f
--- /dev/null
+++ b/test/lib/completions/abook.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "abook "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/acroread.exp b/test/lib/completions/acroread.exp
new file mode 100644
index 00000000..4f11f905
--- /dev/null
+++ b/test/lib/completions/acroread.exp
@@ -0,0 +1,22 @@
+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()
+
+
+setup
+
+
+assert_complete {"bar bar.d/" foo.d/ t.pdf} "acroread fixtures/shared/default/"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/add_members.exp b/test/lib/completions/add_members.exp
new file mode 100644
index 00000000..02cd762d
--- /dev/null
+++ b/test/lib/completions/add_members.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "add_members -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/alias.exp b/test/lib/completions/alias.exp
new file mode 100644
index 00000000..e6b88d00
--- /dev/null
+++ b/test/lib/completions/alias.exp
@@ -0,0 +1,43 @@
+proc setup {} {
+ assert_bash_exec "unalias -a"; # Remove all aliases
+ 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
+
+
+set test "Tab should complete alias"
+ # Try completion
+set cmd "alias "
+assert_complete {bar foo} $cmd $test
+
+
+sync_after_int
+
+
+set test "Tab should complete alias at cursor position"
+ # Try completion
+set cmd "alias foo"
+append cmd \002\002\002; # \002 = ^B = Move cursor left in bash emacs mode
+send "$cmd\t"
+expect {
+ -re "^alias foo\b\b\b\r\nbar +foo *\r\n/@alias foo\b\b\b$" { pass "$test" }
+ -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
+
+
+teardown
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/animate.exp
new file mode 100644
index 00000000..26065d25
--- /dev/null
+++ b/test/lib/completions/animate.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "animate "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ant.exp b/test/lib/completions/ant.exp
new file mode 100644
index 00000000..81294439
--- /dev/null
+++ b/test/lib/completions/ant.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ant -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/apache2ctl.exp b/test/lib/completions/apache2ctl.exp
new file mode 100644
index 00000000..e63abb16
--- /dev/null
+++ b/test/lib/completions/apache2ctl.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "apache2ctl "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/apt-build.exp b/test/lib/completions/apt-build.exp
new file mode 100644
index 00000000..fd09d0eb
--- /dev/null
+++ b/test/lib/completions/apt-build.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "apt-build "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/apt-cache.exp b/test/lib/completions/apt-cache.exp
new file mode 100644
index 00000000..5336beab
--- /dev/null
+++ b/test/lib/completions/apt-cache.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "apt-cache "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/apt-get.exp b/test/lib/completions/apt-get.exp
new file mode 100644
index 00000000..6bd0f3a2
--- /dev/null
+++ b/test/lib/completions/apt-get.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set commands {autoclean autoremove build-dep check clean dist-upgrade
+ dselect-upgrade install purge remove source update upgrade}
+assert_complete $commands "apt-get "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/aptitude.exp b/test/lib/completions/aptitude.exp
new file mode 100644
index 00000000..dde6d26e
--- /dev/null
+++ b/test/lib/completions/aptitude.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "aptitude "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/arch.exp b/test/lib/completions/arch.exp
new file mode 100644
index 00000000..9f7114c4
--- /dev/null
+++ b/test/lib/completions/arch.exp
@@ -0,0 +1,21 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set options {--wipe -s --start= -e --end= -q --quiet -h --help}
+assert_complete $options "arch -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/arpspoof.exp b/test/lib/completions/arpspoof.exp
new file mode 100644
index 00000000..7db79f50
--- /dev/null
+++ b/test/lib/completions/arpspoof.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "arpspoof -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/aspell.exp b/test/lib/completions/aspell.exp
new file mode 100644
index 00000000..4edeb03b
--- /dev/null
+++ b/test/lib/completions/aspell.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "aspell "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/autoconf.exp b/test/lib/completions/autoconf.exp
new file mode 100644
index 00000000..4a44b651
--- /dev/null
+++ b/test/lib/completions/autoconf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "autoconf "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/automake.exp b/test/lib/completions/automake.exp
new file mode 100644
index 00000000..cf27364a
--- /dev/null
+++ b/test/lib/completions/automake.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "automake "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/autorpm.exp b/test/lib/completions/autorpm.exp
new file mode 100644
index 00000000..99b743ca
--- /dev/null
+++ b/test/lib/completions/autorpm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "autorpm "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/awk.exp b/test/lib/completions/awk.exp
new file mode 100644
index 00000000..4288adbf
--- /dev/null
+++ b/test/lib/completions/awk.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "awk "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/bash.exp b/test/lib/completions/bash.exp
new file mode 100644
index 00000000..4caf58fc
--- /dev/null
+++ b/test/lib/completions/bash.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "bash --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/bc.exp b/test/lib/completions/bc.exp
new file mode 100644
index 00000000..c437d037
--- /dev/null
+++ b/test/lib/completions/bc.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "bc --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/bison.exp b/test/lib/completions/bison.exp
new file mode 100644
index 00000000..a3dea1e0
--- /dev/null
+++ b/test/lib/completions/bison.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "bison --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/bk.exp b/test/lib/completions/bk.exp
new file mode 100644
index 00000000..4915136e
--- /dev/null
+++ b/test/lib/completions/bk.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "bk "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/brctl.exp b/test/lib/completions/brctl.exp
new file mode 100644
index 00000000..d87002a2
--- /dev/null
+++ b/test/lib/completions/brctl.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "brctl "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/btdownloadcurses.py.exp b/test/lib/completions/btdownloadcurses.py.exp
new file mode 100644
index 00000000..9dc0ba5a
--- /dev/null
+++ b/test/lib/completions/btdownloadcurses.py.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "btdownloadcurses.py "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/btdownloadgui.py.exp b/test/lib/completions/btdownloadgui.py.exp
new file mode 100644
index 00000000..03897a53
--- /dev/null
+++ b/test/lib/completions/btdownloadgui.py.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "btdownloadgui.py "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/btdownloadheadless.py.exp b/test/lib/completions/btdownloadheadless.py.exp
new file mode 100644
index 00000000..69c62950
--- /dev/null
+++ b/test/lib/completions/btdownloadheadless.py.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "btdownloadheadless.py "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/bzip2.exp b/test/lib/completions/bzip2.exp
new file mode 100644
index 00000000..e5389a2a
--- /dev/null
+++ b/test/lib/completions/bzip2.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "bzip2 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/c++.exp b/test/lib/completions/c++.exp
new file mode 100644
index 00000000..1fe4bb13
--- /dev/null
+++ b/test/lib/completions/c++.exp
@@ -0,0 +1,21 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set test "Tab should complete"
+assert_complete_any "c++ "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cancel.exp b/test/lib/completions/cancel.exp
new file mode 100644
index 00000000..24ca47c4
--- /dev/null
+++ b/test/lib/completions/cancel.exp
@@ -0,0 +1,31 @@
+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"]} {
+ # 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]
+ # Retrieve list of all current print jobs
+ assert_exec {lpstat | cut -d\040 -f1} jobs
+ # Completion should show all print jobs
+ assert_complete $jobs "cancel "
+ # Remove/cancel the test print job
+ assert_exec "cancel $job_id"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cardctl.exp b/test/lib/completions/cardctl.exp
new file mode 100644
index 00000000..b5d7e88d
--- /dev/null
+++ b/test/lib/completions/cardctl.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cardctl "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cat.exp b/test/lib/completions/cat.exp
new file mode 100644
index 00000000..46e8775f
--- /dev/null
+++ b/test/lib/completions/cat.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cat "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cc.exp b/test/lib/completions/cc.exp
new file mode 100644
index 00000000..1d63d006
--- /dev/null
+++ b/test/lib/completions/cc.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cc "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cd.exp b/test/lib/completions/cd.exp
new file mode 100644
index 00000000..58233575
--- /dev/null
+++ b/test/lib/completions/cd.exp
@@ -0,0 +1,47 @@
+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
+
+
+sync_after_int
+
+
+set test "Tab should complete cd at cursor position"
+ # Try completion
+set cmd "cd 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 /@ { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test "Tab should complete CDPATH"
+ # Set CDPATH
+assert_bash_exec "CDPATH=\$PWD";
+assert_complete "fixtures/shared/default/foo.d/" "cd fixtures/shared/default/fo" $test
+sync_after_int
+ # Reset CDPATH
+assert_bash_exec "unset CDPATH"
+
+
+teardown
diff --git a/test/lib/completions/cdrecord.exp b/test/lib/completions/cdrecord.exp
new file mode 100644
index 00000000..d369f79d
--- /dev/null
+++ b/test/lib/completions/cdrecord.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cdrecord -d"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/change_pw.exp b/test/lib/completions/change_pw.exp
new file mode 100644
index 00000000..ca9bcdbd
--- /dev/null
+++ b/test/lib/completions/change_pw.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "change_pw -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/check_db.exp b/test/lib/completions/check_db.exp
new file mode 100644
index 00000000..ca59a715
--- /dev/null
+++ b/test/lib/completions/check_db.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "check_db -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/check_perms.exp b/test/lib/completions/check_perms.exp
new file mode 100644
index 00000000..a58995b0
--- /dev/null
+++ b/test/lib/completions/check_perms.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "check_perms -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/chgrp.exp b/test/lib/completions/chgrp.exp
new file mode 100644
index 00000000..8dfeea79
--- /dev/null
+++ b/test/lib/completions/chgrp.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "chgrp "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/chkconfig.exp b/test/lib/completions/chkconfig.exp
new file mode 100644
index 00000000..e7469b34
--- /dev/null
+++ b/test/lib/completions/chkconfig.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "chkconfig "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/chown.exp b/test/lib/completions/chown.exp
new file mode 100644
index 00000000..953b2b02
--- /dev/null
+++ b/test/lib/completions/chown.exp
@@ -0,0 +1,72 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set users [exec bash -c "compgen -A user"]
+assert_complete $users "chown "
+
+
+sync_after_int
+
+
+# Find user/group suitable for testing.
+set failed_find_unique_completion 0
+foreach ug {user group} {
+ # compgen -A is used because it's a bash builtin and available everywhere.
+ # The || true part prevents exec from throwing an exception if nothing is
+ # found (very very unlikely).
+ set list [split [exec bash -c "compgen -A $ug || true"] "\n"]
+ if {![find_unique_completion_pair $list part$ug full$ug]} {
+ untested "Not running complex chown tests; no suitable test $ug found."
+ set failed_find_unique_completion 1
+ }
+}
+
+# These tests require an unique completion.
+if {!$failed_find_unique_completion} {
+ assert_complete $fulluser "chown $partuser"
+ sync_after_int
+
+ 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"
+ sync_after_int
+
+ foreach prefix {
+ "funky\\ 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>"
+ #assert_complete_into "chown $prefix$partgroup" "chown $prefix$fullgroup " $test
+ assert_complete $prefix$fullgroup "chown $prefix$partgroup" $test
+ sync_after_int
+ }
+
+ # Check that we give up in degenerate cases instead of spewing various junk.
+
+ assert_no_complete "chown $fulluser\\\\:$partgroup"
+ sync_after_int
+
+ assert_no_complete "chown $fulluser\\\\\\:$partgroup"
+ sync_after_int
+
+ assert_no_complete "chown $fulluser\\\\\\\\:$partgroup"
+ sync_after_int
+
+ # Colons in user/groupnames are not usually allowed.
+ assert_no_complete "chown foo:bar:$partgroup"
+ sync_after_int
+}
+
+
+teardown
diff --git a/test/lib/completions/chsh.exp b/test/lib/completions/chsh.exp
new file mode 100644
index 00000000..99262a2c
--- /dev/null
+++ b/test/lib/completions/chsh.exp
@@ -0,0 +1,26 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "chsh -s "
+
+
+sync_after_int
+
+
+assert_complete [exec bash -c "compgen -A user"] "chsh "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ci.exp b/test/lib/completions/ci.exp
new file mode 100644
index 00000000..09105eec
--- /dev/null
+++ b/test/lib/completions/ci.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ci "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/civclient.exp b/test/lib/completions/civclient.exp
new file mode 100644
index 00000000..8159c2bc
--- /dev/null
+++ b/test/lib/completions/civclient.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "civclient -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/civserver.exp b/test/lib/completions/civserver.exp
new file mode 100644
index 00000000..df459688
--- /dev/null
+++ b/test/lib/completions/civserver.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "civserver -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cksfv.exp b/test/lib/completions/cksfv.exp
new file mode 100644
index 00000000..a40a5023
--- /dev/null
+++ b/test/lib/completions/cksfv.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cksfv -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cleanarch.exp b/test/lib/completions/cleanarch.exp
new file mode 100644
index 00000000..e3145e81
--- /dev/null
+++ b/test/lib/completions/cleanarch.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cleanarch -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/clisp.exp b/test/lib/completions/clisp.exp
new file mode 100644
index 00000000..2bc599ac
--- /dev/null
+++ b/test/lib/completions/clisp.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "clisp "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/clone_member.exp b/test/lib/completions/clone_member.exp
new file mode 100644
index 00000000..34b4db57
--- /dev/null
+++ b/test/lib/completions/clone_member.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "clone_member -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/co.exp b/test/lib/completions/co.exp
new file mode 100644
index 00000000..49fe3a64
--- /dev/null
+++ b/test/lib/completions/co.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "co "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/composite.exp b/test/lib/completions/composite.exp
new file mode 100644
index 00000000..e39ce72f
--- /dev/null
+++ b/test/lib/completions/composite.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "composite "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/config_list.exp b/test/lib/completions/config_list.exp
new file mode 100644
index 00000000..5246c860
--- /dev/null
+++ b/test/lib/completions/config_list.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "config_list -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/configure.exp b/test/lib/completions/configure.exp
new file mode 100644
index 00000000..74afba1b
--- /dev/null
+++ b/test/lib/completions/configure.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "configure --prefix "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/convert.exp b/test/lib/completions/convert.exp
new file mode 100644
index 00000000..d8a77e35
--- /dev/null
+++ b/test/lib/completions/convert.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "convert "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cowsay.exp b/test/lib/completions/cowsay.exp
new file mode 100644
index 00000000..dfbefe1a
--- /dev/null
+++ b/test/lib/completions/cowsay.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cowsay "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cp.exp b/test/lib/completions/cp.exp
new file mode 100644
index 00000000..9fe46537
--- /dev/null
+++ b/test/lib/completions/cp.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cp "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cpio.exp b/test/lib/completions/cpio.exp
new file mode 100644
index 00000000..b02f2719
--- /dev/null
+++ b/test/lib/completions/cpio.exp
@@ -0,0 +1,26 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cpio --"
+
+
+sync_after_int
+
+
+assert_complete [exec bash -c "compgen -A user"] "cpio -R "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/createdb.exp b/test/lib/completions/createdb.exp
new file mode 100644
index 00000000..1e5cdbe7
--- /dev/null
+++ b/test/lib/completions/createdb.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "createdb "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cryptsetup.exp b/test/lib/completions/cryptsetup.exp
new file mode 100644
index 00000000..e94c3ac1
--- /dev/null
+++ b/test/lib/completions/cryptsetup.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cryptsetup "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/csplit.exp b/test/lib/completions/csplit.exp
new file mode 100644
index 00000000..3a66a627
--- /dev/null
+++ b/test/lib/completions/csplit.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "csplit "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cut.exp b/test/lib/completions/cut.exp
new file mode 100644
index 00000000..b9bcf6c5
--- /dev/null
+++ b/test/lib/completions/cut.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cut "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cvs.exp b/test/lib/completions/cvs.exp
new file mode 100644
index 00000000..2a26da8e
--- /dev/null
+++ b/test/lib/completions/cvs.exp
@@ -0,0 +1,36 @@
+proc setup {} {
+ save_env
+ assert_bash_exec {OLDHOME=$HOME ; HOME=$TESTDIR/fixtures/cvs}
+}; # setup()
+
+
+proc teardown {} {
+ assert_bash_exec {HOME=$OLDHOME}
+ assert_env_unmodified {
+ /OLDHOME=/d
+ }
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cvs "
+
+
+sync_after_int
+
+
+set test "-d should complete CVS roots"
+set cmd "cvs -d "
+send "$cmd\t"
+expect {
+ -re "^$cmd\r\n.*:pserver:.*\r\n/@$cmd:pserver:.*$" { pass "$test" }
+ default { fail "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/cvsps.exp b/test/lib/completions/cvsps.exp
new file mode 100644
index 00000000..1fd4a0a9
--- /dev/null
+++ b/test/lib/completions/cvsps.exp
@@ -0,0 +1,36 @@
+proc setup {} {
+ save_env
+ assert_bash_exec {OLDHOME=$HOME ; HOME=$TESTDIR/fixtures/cvs}
+}; # setup()
+
+
+proc teardown {} {
+ assert_bash_exec {HOME=$OLDHOME}
+ assert_env_unmodified {
+ /OLDHOME=/d
+ }
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "cvsps -"
+
+
+sync_after_int
+
+
+set test "No arguments should complete CVS roots"
+set cmd "cvsps "
+send "$cmd\t"
+expect {
+ -re "^$cmd\r\n.*:pserver:.*\r\n/@$cmd:pserver:.*$" { pass "$test" }
+ default { fail "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/date.exp b/test/lib/completions/date.exp
new file mode 100644
index 00000000..9d75f5f3
--- /dev/null
+++ b/test/lib/completions/date.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "date "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dcop.exp b/test/lib/completions/dcop.exp
new file mode 100644
index 00000000..6ed800c5
--- /dev/null
+++ b/test/lib/completions/dcop.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {dcop} words]} {
+ assert_complete $words "dcop "
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dd.exp b/test/lib/completions/dd.exp
new file mode 100644
index 00000000..400dd143
--- /dev/null
+++ b/test/lib/completions/dd.exp
@@ -0,0 +1,33 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dd --"
+
+
+sync_after_int
+
+
+set test "option should be suffixed with ="
+set cmd "dd if"
+send "$cmd\t"
+expect -ex "$cmd"
+expect {
+ -re "^=$" { pass $test }
+ -re {^\\=$} { xfail $test }
+}; # expect
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/df.exp b/test/lib/completions/df.exp
new file mode 100644
index 00000000..487d70a9
--- /dev/null
+++ b/test/lib/completions/df.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "df "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dhclient.exp b/test/lib/completions/dhclient.exp
new file mode 100644
index 00000000..42c14c82
--- /dev/null
+++ b/test/lib/completions/dhclient.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dhclient -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dict.exp b/test/lib/completions/dict.exp
new file mode 100644
index 00000000..32fb4988
--- /dev/null
+++ b/test/lib/completions/dict.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dict -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/diff.exp b/test/lib/completions/diff.exp
new file mode 100644
index 00000000..c009f640
--- /dev/null
+++ b/test/lib/completions/diff.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "diff --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dir.exp b/test/lib/completions/dir.exp
new file mode 100644
index 00000000..6e20d37d
--- /dev/null
+++ b/test/lib/completions/dir.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dir "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/display.exp b/test/lib/completions/display.exp
new file mode 100644
index 00000000..9a9d6901
--- /dev/null
+++ b/test/lib/completions/display.exp
@@ -0,0 +1,41 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "display "
+
+
+sync_after_int
+
+
+set test "- should complete options"
+set options {
+ -alpha -antialias -authenticate -auto-orient -backdrop -background -border
+ -bordercolor -borderwidth -channel -clip -clip-path -coalesce -colormap
+ -colors -colorspace -comment -compress -contrast -crop -debug -decipher
+ -define -delay -density -depth -despeckle -display -dispose -dither -edge
+ -endian -enhance -extract -filter -flatten -flip -flop -font -foreground
+ -format -frame -gamma -geometry -help -iconGeometry -iconic -identify
+ -immutable -interlace -interpolate -label -limit -list -log -loop -map
+ -mattecolor -monitor -monochrome -name -negate -page -profile -quality
+ -quantize -quiet -raise -regard-warnings -remote -repage -resample -resize
+ -respect-parenthesis -roll -rotate -sample -sampling-factor -scenes -seed
+ -segment -set -shared-memory -sharpen -size -strip -texture -title
+ -transparent-color -treedepth -trim -update -usePixmap -verbose -version
+ -virtual-pixel -visual -window -window-group -write }
+assert_complete $options "display -" $test
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dnsspoof.exp b/test/lib/completions/dnsspoof.exp
new file mode 100644
index 00000000..3223a349
--- /dev/null
+++ b/test/lib/completions/dnsspoof.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dnsspoof -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dpkg-deb.exp b/test/lib/completions/dpkg-deb.exp
new file mode 100644
index 00000000..c8656610
--- /dev/null
+++ b/test/lib/completions/dpkg-deb.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dpkg-deb --c"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dpkg-reconfigure.exp b/test/lib/completions/dpkg-reconfigure.exp
new file mode 100644
index 00000000..267594be
--- /dev/null
+++ b/test/lib/completions/dpkg-reconfigure.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dpkg-reconfigure --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dpkg-source.exp b/test/lib/completions/dpkg-source.exp
new file mode 100644
index 00000000..a21eff45
--- /dev/null
+++ b/test/lib/completions/dpkg-source.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dpkg-source -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dpkg.exp b/test/lib/completions/dpkg.exp
new file mode 100644
index 00000000..2bd1fb6e
--- /dev/null
+++ b/test/lib/completions/dpkg.exp
@@ -0,0 +1,29 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dpkg --c"
+
+
+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
+
+
+teardown
diff --git a/test/lib/completions/dropdb.exp b/test/lib/completions/dropdb.exp
new file mode 100644
index 00000000..e78a2ba7
--- /dev/null
+++ b/test/lib/completions/dropdb.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dropdb "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dselect.exp b/test/lib/completions/dselect.exp
new file mode 100644
index 00000000..f6257294
--- /dev/null
+++ b/test/lib/completions/dselect.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dselect "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dsniff.exp b/test/lib/completions/dsniff.exp
new file mode 100644
index 00000000..a0cc43ac
--- /dev/null
+++ b/test/lib/completions/dsniff.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dsniff -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/du.exp b/test/lib/completions/du.exp
new file mode 100644
index 00000000..d1ffa8ca
--- /dev/null
+++ b/test/lib/completions/du.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "du "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/dumpdb.exp b/test/lib/completions/dumpdb.exp
new file mode 100644
index 00000000..240214b3
--- /dev/null
+++ b/test/lib/completions/dumpdb.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "dumpdb "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/enscript.exp b/test/lib/completions/enscript.exp
new file mode 100644
index 00000000..7fefabdd
--- /dev/null
+++ b/test/lib/completions/enscript.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "enscript --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/env.exp b/test/lib/completions/env.exp
new file mode 100644
index 00000000..f03f5395
--- /dev/null
+++ b/test/lib/completions/env.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {env --help} "" "" "unsupported"]} {
+ assert_complete_any "env --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/evince.exp b/test/lib/completions/evince.exp
new file mode 100644
index 00000000..22279a26
--- /dev/null
+++ b/test/lib/completions/evince.exp
@@ -0,0 +1,35 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}; # teardown()
+
+
+setup
+
+
+# NOTE: The directory `fixtures/evince' contains an additional subdir `foo'
+# (should be visible as completion) and an additional file `.txt'
+# (shouldn't be visible as completion)
+set files {
+ foo/
+ .bmp .BMP .cbr .CBR .cbz .CBZ .djv .DJV .djvu .DJVU
+ .dvi .DVI .dvi.bz2 .dvi.BZ2 .DVI.bz2 .DVI.BZ2 .dvi.gz .dvi.GZ .DVI.gz .DVI.GZ
+ .eps .EPS .eps.bz2 .eps.BZ2 .EPS.bz2 .EPS.BZ2 .eps.gz .eps.GZ .EPS.gz .EPS.GZ
+ .gif .GIF .ico .ICO .jpeg .JPEG .jpg .JPG .miff .MIFF .pbm .PBM .pcx .PCX
+ .pdf .PDF .pdf.bz2 .pdf.BZ2 .PDF.bz2 .PDF.BZ2 .pdf.gz .pdf.GZ .PDF.gz .PDF.GZ
+ .pgm .PGM .png .PNG .pnm .PNM .ppm .PPM
+ .ps .PS .ps.bz2 .ps.BZ2 .PS.bz2 .PS.BZ2 .ps.gz .ps.GZ .PS.gz .PS.GZ
+ .tga .TGA .tif .TIF .tiff .TIFF
+ .xpm .XPM .xwd .XWD
+}
+assert_complete_dir $files "evince " "fixtures/evince"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/expand.exp b/test/lib/completions/expand.exp
new file mode 100644
index 00000000..d5cd6b17
--- /dev/null
+++ b/test/lib/completions/expand.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {expand --help} "" "" "unsupported"]} {
+ assert_complete_any "expand --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/filesnarf.exp b/test/lib/completions/filesnarf.exp
new file mode 100644
index 00000000..53cf01e4
--- /dev/null
+++ b/test/lib/completions/filesnarf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "filesnarf -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/find.exp b/test/lib/completions/find.exp
new file mode 100644
index 00000000..4b1728dc
--- /dev/null
+++ b/test/lib/completions/find.exp
@@ -0,0 +1,80 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "find "
+
+
+sync_after_int
+
+
+assert_complete_any "find -fstype "
+
+
+sync_after_int
+
+
+set options [list -daystart -depth -follow -help \
+ -ignore_readdir_race -maxdepth -mindepth -mindepth -mount \
+ -noignore_readdir_race -noleaf -regextype -version -warn -nowarn \
+ -xdev \
+ -amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false \
+ -fstype -gid -group -ilname -iname -inum -ipath -iregex -iwholename \
+ -links -lname -mmin -mtime -name -newer -nogroup -nouser -path -perm \
+ -readable -regex -samefile -size -true -type -uid -used -user \
+ -wholename -writable -xtype -context \
+ -delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir \
+ -print -print0 -printf -prune -quit]
+assert_complete $options {find -}
+
+
+sync_after_int
+
+
+set test "-wholename should complete files/dirs"
+set dir fixtures/shared/default
+set files [split [exec bash -c "cd $dir && ls -p"] "\n"]
+assert_complete_dir $files "find -wholename " $dir
+
+
+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
+
+
+teardown
diff --git a/test/lib/completions/find_member.exp b/test/lib/completions/find_member.exp
new file mode 100644
index 00000000..58fac7d2
--- /dev/null
+++ b/test/lib/completions/find_member.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "find_member -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp
new file mode 100644
index 00000000..30f2b080
--- /dev/null
+++ b/test/lib/completions/finger.exp
@@ -0,0 +1,57 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set test "Tab should complete usernames"
+# Build string list of usernames
+set users {}
+foreach u [exec bash -c "compgen -A user"] {
+ lappend users $u
+}; # foreach
+assert_complete $users "finger " $test
+
+
+sync_after_int
+
+
+set test "Tab should complete partial username"
+assert_complete_partial [exec bash -c "compgen -A user"] "finger"
+
+
+sync_after_int
+
+
+set test "Tab should complete partial hostname"
+# Build string list of hostnames, starting with the character of the first
+# host, unless host starts with a COMP_WORDBREAKS character, e.g. a colon (:).
+# Hosts starting with a COMP_WORDBREAKS character are left out because these
+# are exceptional cases, requiring specific tests.
+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 != ""} {
+ # 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
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/fmt.exp b/test/lib/completions/fmt.exp
new file mode 100644
index 00000000..28570682
--- /dev/null
+++ b/test/lib/completions/fmt.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {fmt --help} "" "" "unsupported"]} {
+ assert_complete_any "fmt -"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/fold.exp b/test/lib/completions/fold.exp
new file mode 100644
index 00000000..a5230b03
--- /dev/null
+++ b/test/lib/completions/fold.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {fold --help} "" "" "unsupported"]} {
+ assert_complete_any "fold --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/g++.exp b/test/lib/completions/g++.exp
new file mode 100644
index 00000000..4dc2591a
--- /dev/null
+++ b/test/lib/completions/g++.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "g++ "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/g4.exp b/test/lib/completions/g4.exp
new file mode 100644
index 00000000..203de061
--- /dev/null
+++ b/test/lib/completions/g4.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "g4 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/g77.exp b/test/lib/completions/g77.exp
new file mode 100644
index 00000000..8802aca9
--- /dev/null
+++ b/test/lib/completions/g77.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "g77 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gcc.exp b/test/lib/completions/gcc.exp
new file mode 100644
index 00000000..8e52a120
--- /dev/null
+++ b/test/lib/completions/gcc.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gcc "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gcj.exp b/test/lib/completions/gcj.exp
new file mode 100644
index 00000000..db52d59a
--- /dev/null
+++ b/test/lib/completions/gcj.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gcj "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gcl.exp b/test/lib/completions/gcl.exp
new file mode 100644
index 00000000..7cead846
--- /dev/null
+++ b/test/lib/completions/gcl.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gcl "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gdb.exp b/test/lib/completions/gdb.exp
new file mode 100644
index 00000000..982f0878
--- /dev/null
+++ b/test/lib/completions/gdb.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gdb - "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/genaliases.exp b/test/lib/completions/genaliases.exp
new file mode 100644
index 00000000..064eb386
--- /dev/null
+++ b/test/lib/completions/genaliases.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "genaliases -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/getent.exp b/test/lib/completions/getent.exp
new file mode 100644
index 00000000..121f3b38
--- /dev/null
+++ b/test/lib/completions/getent.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "getent "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gkrellm.exp b/test/lib/completions/gkrellm.exp
new file mode 100644
index 00000000..f8b0dd4d
--- /dev/null
+++ b/test/lib/completions/gkrellm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gkrellm -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gmplayer.exp b/test/lib/completions/gmplayer.exp
new file mode 100644
index 00000000..d9032698
--- /dev/null
+++ b/test/lib/completions/gmplayer.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gmplayer "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gnatmake.exp b/test/lib/completions/gnatmake.exp
new file mode 100644
index 00000000..902aa062
--- /dev/null
+++ b/test/lib/completions/gnatmake.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gnatmake "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gpc.exp b/test/lib/completions/gpc.exp
new file mode 100644
index 00000000..6c4d0383
--- /dev/null
+++ b/test/lib/completions/gpc.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gpc "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gperf.exp b/test/lib/completions/gperf.exp
new file mode 100644
index 00000000..aa24333e
--- /dev/null
+++ b/test/lib/completions/gperf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gperf --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gpg.exp b/test/lib/completions/gpg.exp
new file mode 100644
index 00000000..29fd2244
--- /dev/null
+++ b/test/lib/completions/gpg.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "gpg "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gprof.exp b/test/lib/completions/gprof.exp
new file mode 100644
index 00000000..592786af
--- /dev/null
+++ b/test/lib/completions/gprof.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {gprof --help} "" "" "unsupported"]} {
+ assert_complete_any "gprof --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/grep.exp b/test/lib/completions/grep.exp
new file mode 100644
index 00000000..3814df71
--- /dev/null
+++ b/test/lib/completions/grep.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "grep --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/grub.exp b/test/lib/completions/grub.exp
new file mode 100644
index 00000000..9578e789
--- /dev/null
+++ b/test/lib/completions/grub.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "grub --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/gzip.exp b/test/lib/completions/gzip.exp
new file mode 100644
index 00000000..f212c61a
--- /dev/null
+++ b/test/lib/completions/gzip.exp
@@ -0,0 +1,28 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set test "Tab should complete"
+ # Try completion
+set cmd "gzip "
+send "$cmd\t"
+expect {
+ -re "^$cmd\r\n.*$cmd$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}; # expect
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/hcitool.exp b/test/lib/completions/hcitool.exp
new file mode 100644
index 00000000..9283adff
--- /dev/null
+++ b/test/lib/completions/hcitool.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "hcitool "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/head.exp b/test/lib/completions/head.exp
new file mode 100644
index 00000000..0d4f6a20
--- /dev/null
+++ b/test/lib/completions/head.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {head --help} "" "" "unsupported"]} {
+ assert_complete_any "head --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/iconv.exp b/test/lib/completions/iconv.exp
new file mode 100644
index 00000000..420e923c
--- /dev/null
+++ b/test/lib/completions/iconv.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "iconv -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/id.exp b/test/lib/completions/id.exp
new file mode 100644
index 00000000..155af52c
--- /dev/null
+++ b/test/lib/completions/id.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "id -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/identify.exp b/test/lib/completions/identify.exp
new file mode 100644
index 00000000..8f38ae47
--- /dev/null
+++ b/test/lib/completions/identify.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "identify -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ifdown.exp b/test/lib/completions/ifdown.exp
new file mode 100644
index 00000000..68225bb9
--- /dev/null
+++ b/test/lib/completions/ifdown.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ifdown "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ifup.exp b/test/lib/completions/ifup.exp
new file mode 100644
index 00000000..9d717178
--- /dev/null
+++ b/test/lib/completions/ifup.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ifup "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/indent.exp b/test/lib/completions/indent.exp
new file mode 100644
index 00000000..e8fc32b1
--- /dev/null
+++ b/test/lib/completions/indent.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "indent --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/info.exp b/test/lib/completions/info.exp
new file mode 100644
index 00000000..ed769f1a
--- /dev/null
+++ b/test/lib/completions/info.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "info "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/inject.exp b/test/lib/completions/inject.exp
new file mode 100644
index 00000000..7c093146
--- /dev/null
+++ b/test/lib/completions/inject.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "inject "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/insmod.exp b/test/lib/completions/insmod.exp
new file mode 100644
index 00000000..8e83f0b4
--- /dev/null
+++ b/test/lib/completions/insmod.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "insmod in"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/invoke-rc.d.exp b/test/lib/completions/invoke-rc.d.exp
new file mode 100644
index 00000000..4dc9f1d8
--- /dev/null
+++ b/test/lib/completions/invoke-rc.d.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "invoke-rc.d "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ipsec.exp b/test/lib/completions/ipsec.exp
new file mode 100644
index 00000000..15617a16
--- /dev/null
+++ b/test/lib/completions/ipsec.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ipsec "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ipv6calc.exp b/test/lib/completions/ipv6calc.exp
new file mode 100644
index 00000000..74ce95f7
--- /dev/null
+++ b/test/lib/completions/ipv6calc.exp
@@ -0,0 +1,26 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ipv6calc -"
+
+
+sync_after_int
+
+
+assert_complete_any "ipv6calc --in "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/irb.exp b/test/lib/completions/irb.exp
new file mode 100644
index 00000000..81bea6d2
--- /dev/null
+++ b/test/lib/completions/irb.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "irb "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/isql.exp b/test/lib/completions/isql.exp
new file mode 100644
index 00000000..87e16bca
--- /dev/null
+++ b/test/lib/completions/isql.exp
@@ -0,0 +1,23 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/ODBCINI=/d}
+}; # teardown()
+
+
+setup
+
+
+assert_bash_exec {OLDODBCINI=$ODBCINI; ODBCINI=$TESTDIR/fixtures/isql/odbc.ini}
+assert_complete_any "isql "
+sync_after_int
+assert_bash_exec {ODBCINI=$OLDODBCINI; unset -v OLDODBCINI}
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/iwconfig.exp b/test/lib/completions/iwconfig.exp
new file mode 100644
index 00000000..f09719d7
--- /dev/null
+++ b/test/lib/completions/iwconfig.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "iwconfig --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/iwlist.exp b/test/lib/completions/iwlist.exp
new file mode 100644
index 00000000..80a2c367
--- /dev/null
+++ b/test/lib/completions/iwlist.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "iwlist --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/iwpriv.exp b/test/lib/completions/iwpriv.exp
new file mode 100644
index 00000000..f3102cc5
--- /dev/null
+++ b/test/lib/completions/iwpriv.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "iwpriv --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/iwspy.exp b/test/lib/completions/iwspy.exp
new file mode 100644
index 00000000..5fa0bee5
--- /dev/null
+++ b/test/lib/completions/iwspy.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_env_unmodified "iwspy --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/jar.exp b/test/lib/completions/jar.exp
new file mode 100644
index 00000000..0e11f684
--- /dev/null
+++ b/test/lib/completions/jar.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "jar "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/jarsigner.exp b/test/lib/completions/jarsigner.exp
new file mode 100644
index 00000000..075e0263
--- /dev/null
+++ b/test/lib/completions/jarsigner.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "jarsigner "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/java.exp b/test/lib/completions/java.exp
new file mode 100644
index 00000000..14610b2f
--- /dev/null
+++ b/test/lib/completions/java.exp
@@ -0,0 +1,46 @@
+proc setup {} {
+ assert_bash_exec {CLASSPATH=$TESTDIR/fixtures/java/a:$TESTDIR/fixtures/java/bashcomp.jar}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "java -"
+
+
+sync_after_int
+
+
+assert_complete "b bashcomp.jarred toplevel" "java "
+
+
+sync_after_int
+
+
+assert_complete "bashcomp.jarred toplevel" \
+ "java -cp fixtures/java/bashcomp.jar "
+
+
+sync_after_int
+
+
+assert_no_complete "java -cp \"\" "
+
+
+sync_after_int
+
+
+assert_complete "a/ bashcomp.jar" "java -jar fixtures/java/"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/javac.exp b/test/lib/completions/javac.exp
new file mode 100644
index 00000000..6013de11
--- /dev/null
+++ b/test/lib/completions/javac.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "javac "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/javadoc.exp b/test/lib/completions/javadoc.exp
new file mode 100644
index 00000000..40c922ca
--- /dev/null
+++ b/test/lib/completions/javadoc.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "javadoc "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/k3b.exp b/test/lib/completions/k3b.exp
new file mode 100644
index 00000000..86942d67
--- /dev/null
+++ b/test/lib/completions/k3b.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "k3b "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/kdvi.exp b/test/lib/completions/kdvi.exp
new file mode 100644
index 00000000..0196049a
--- /dev/null
+++ b/test/lib/completions/kdvi.exp
@@ -0,0 +1,27 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}; # teardown()
+
+
+setup
+
+
+# NOTE: The directory `fixtures/kdvi' contains an additional subdir `foo'
+# (should be visible as completion) and an additional file `.txt'
+# (shouldn't be visible as completion)
+set files {
+ foo/
+ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz .DVI.gz .dvi.Z .DVI.Z
+}
+assert_complete_dir $files "kdvi " "fixtures/kdvi"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/kill.exp b/test/lib/completions/kill.exp
new file mode 100644
index 00000000..ca02650c
--- /dev/null
+++ b/test/lib/completions/kill.exp
@@ -0,0 +1,26 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "kill 1"
+
+
+sync_after_int
+
+
+assert_complete [get_signals] "kill -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/killall.exp b/test/lib/completions/killall.exp
new file mode 100644
index 00000000..763c8e7d
--- /dev/null
+++ b/test/lib/completions/killall.exp
@@ -0,0 +1,26 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "killall "
+
+
+sync_after_int
+
+
+assert_complete [get_signals] "killall -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/kldload.exp b/test/lib/completions/kldload.exp
new file mode 100644
index 00000000..0493a10a
--- /dev/null
+++ b/test/lib/completions/kldload.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "kldload "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/kldunload.exp b/test/lib/completions/kldunload.exp
new file mode 100644
index 00000000..192159a5
--- /dev/null
+++ b/test/lib/completions/kldunload.exp
@@ -0,0 +1,24 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[catch {eval exec {kldstat | grep "\.ko$"}}] == 0} {
+ assert_complete_any "kldunload "
+} else {
+ assert_no_complete "kldunload "
+}
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/kpdf.exp b/test/lib/completions/kpdf.exp
new file mode 100644
index 00000000..010abcfb
--- /dev/null
+++ b/test/lib/completions/kpdf.exp
@@ -0,0 +1,26 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}; # teardown()
+
+
+setup
+
+
+# NOTE: The directory `fixtures/kpdf' contains an additional subdir `foo'
+# (should be visible as completion) and an additional file `.txt'
+# (shouldn't be visible as completion)
+set files {
+ foo/ .eps .ps .EPS .PS .pdf .PDF
+}
+assert_complete_dir $files "kpdf " "fixtures/kpdf"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/kplayer.exp b/test/lib/completions/kplayer.exp
new file mode 100644
index 00000000..34c9b3bf
--- /dev/null
+++ b/test/lib/completions/kplayer.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "kplayer "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/larch.exp b/test/lib/completions/larch.exp
new file mode 100644
index 00000000..076016f2
--- /dev/null
+++ b/test/lib/completions/larch.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "larch library-"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ld.exp b/test/lib/completions/ld.exp
new file mode 100644
index 00000000..60377991
--- /dev/null
+++ b/test/lib/completions/ld.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ld "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ldd.exp b/test/lib/completions/ldd.exp
new file mode 100644
index 00000000..e45d1df7
--- /dev/null
+++ b/test/lib/completions/ldd.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ldd "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/less.exp b/test/lib/completions/less.exp
new file mode 100644
index 00000000..269c9b5c
--- /dev/null
+++ b/test/lib/completions/less.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "less --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lftp.exp b/test/lib/completions/lftp.exp
new file mode 100644
index 00000000..a49a1935
--- /dev/null
+++ b/test/lib/completions/lftp.exp
@@ -0,0 +1,24 @@
+proc setup {} {
+ assert_bash_exec {HOME=$TESTDIR/fixtures/lftp}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set expected [get_hosts]
+# `lftptest' is defined in ./fixtures/lftp/.lftp/bookmarks
+lappend expected lftptest
+assert_complete $expected "lftp "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lftpget.exp b/test/lib/completions/lftpget.exp
new file mode 100644
index 00000000..7d80216e
--- /dev/null
+++ b/test/lib/completions/lftpget.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lftpget -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lilo.exp b/test/lib/completions/lilo.exp
new file mode 100644
index 00000000..505a1470
--- /dev/null
+++ b/test/lib/completions/lilo.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lilo -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/links.exp b/test/lib/completions/links.exp
new file mode 100644
index 00000000..9f4896aa
--- /dev/null
+++ b/test/lib/completions/links.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "links "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lisp.exp b/test/lib/completions/lisp.exp
new file mode 100644
index 00000000..21663628
--- /dev/null
+++ b/test/lib/completions/lisp.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lisp "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/list_admins.exp b/test/lib/completions/list_admins.exp
new file mode 100644
index 00000000..e1c9c4dd
--- /dev/null
+++ b/test/lib/completions/list_admins.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "list_admins -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/list_lists.exp b/test/lib/completions/list_lists.exp
new file mode 100644
index 00000000..789ab1a8
--- /dev/null
+++ b/test/lib/completions/list_lists.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "list_lists -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/list_members.exp b/test/lib/completions/list_members.exp
new file mode 100644
index 00000000..c93b53d7
--- /dev/null
+++ b/test/lib/completions/list_members.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "list_members -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/list_owners.exp b/test/lib/completions/list_owners.exp
new file mode 100644
index 00000000..c96e0229
--- /dev/null
+++ b/test/lib/completions/list_owners.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "list_owners -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ln.exp b/test/lib/completions/ln.exp
new file mode 100644
index 00000000..34786071
--- /dev/null
+++ b/test/lib/completions/ln.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ln "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/look.exp b/test/lib/completions/look.exp
new file mode 100644
index 00000000..53a3c464
--- /dev/null
+++ b/test/lib/completions/look.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {look foo | grep ^foo} words]} {
+ assert_complete $words "look foo"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ls.exp b/test/lib/completions/ls.exp
new file mode 100644
index 00000000..db2d41d3
--- /dev/null
+++ b/test/lib/completions/ls.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {ls --help} "" "" "unsupported"]} {
+ assert_complete_any "ls --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvchange.exp b/test/lib/completions/lvchange.exp
new file mode 100644
index 00000000..ec3886b8
--- /dev/null
+++ b/test/lib/completions/lvchange.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvchange --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvcreate.exp b/test/lib/completions/lvcreate.exp
new file mode 100644
index 00000000..46dceb79
--- /dev/null
+++ b/test/lib/completions/lvcreate.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvcreate --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvdisplay.exp b/test/lib/completions/lvdisplay.exp
new file mode 100644
index 00000000..5a01a0e5
--- /dev/null
+++ b/test/lib/completions/lvdisplay.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvdisplay --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvextend.exp b/test/lib/completions/lvextend.exp
new file mode 100644
index 00000000..24a63853
--- /dev/null
+++ b/test/lib/completions/lvextend.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvextend --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvm.exp b/test/lib/completions/lvm.exp
new file mode 100644
index 00000000..1c67825e
--- /dev/null
+++ b/test/lib/completions/lvm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvm pv"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvmdiskscan.exp b/test/lib/completions/lvmdiskscan.exp
new file mode 100644
index 00000000..27e566d4
--- /dev/null
+++ b/test/lib/completions/lvmdiskscan.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvmdiskscan --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvreduce.exp b/test/lib/completions/lvreduce.exp
new file mode 100644
index 00000000..edd5150d
--- /dev/null
+++ b/test/lib/completions/lvreduce.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvreduce --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvremove.exp b/test/lib/completions/lvremove.exp
new file mode 100644
index 00000000..1cd63150
--- /dev/null
+++ b/test/lib/completions/lvremove.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvremove --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvrename.exp b/test/lib/completions/lvrename.exp
new file mode 100644
index 00000000..51624222
--- /dev/null
+++ b/test/lib/completions/lvrename.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvrename --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvresize.exp b/test/lib/completions/lvresize.exp
new file mode 100644
index 00000000..830b9ab1
--- /dev/null
+++ b/test/lib/completions/lvresize.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvresize --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvs.exp b/test/lib/completions/lvs.exp
new file mode 100644
index 00000000..8b239f5d
--- /dev/null
+++ b/test/lib/completions/lvs.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvs --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lvscan.exp b/test/lib/completions/lvscan.exp
new file mode 100644
index 00000000..841fd0ed
--- /dev/null
+++ b/test/lib/completions/lvscan.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lvscan --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lzma.exp b/test/lib/completions/lzma.exp
new file mode 100644
index 00000000..79d78854
--- /dev/null
+++ b/test/lib/completions/lzma.exp
@@ -0,0 +1,26 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lzma "
+
+
+sync_after_int
+
+
+assert_complete "a/ bashcomp.lzma bashcomp.tlz" "lzma -d fixtures/xz/"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/lzop.exp b/test/lib/completions/lzop.exp
new file mode 100644
index 00000000..c33e814e
--- /dev/null
+++ b/test/lib/completions/lzop.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "lzop "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/m4.exp b/test/lib/completions/m4.exp
new file mode 100644
index 00000000..2cc884b3
--- /dev/null
+++ b/test/lib/completions/m4.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {m4 --help} "" "" "unsupported"]} {
+ assert_complete_any "m4 --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/macof.exp b/test/lib/completions/macof.exp
new file mode 100644
index 00000000..e21b1e77
--- /dev/null
+++ b/test/lib/completions/macof.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "macof -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mailmanctl.exp b/test/lib/completions/mailmanctl.exp
new file mode 100644
index 00000000..a69b7650
--- /dev/null
+++ b/test/lib/completions/mailmanctl.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mailmanctl "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mailsnarf.exp b/test/lib/completions/mailsnarf.exp
new file mode 100644
index 00000000..df9981b7
--- /dev/null
+++ b/test/lib/completions/mailsnarf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mailsnarf -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/make.exp b/test/lib/completions/make.exp
new file mode 100644
index 00000000..90b9e68b
--- /dev/null
+++ b/test/lib/completions/make.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "make "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/man.exp b/test/lib/completions/man.exp
new file mode 100644
index 00000000..62c14c86
--- /dev/null
+++ b/test/lib/completions/man.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "man man"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mc.exp b/test/lib/completions/mc.exp
new file mode 100644
index 00000000..866161ba
--- /dev/null
+++ b/test/lib/completions/mc.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mc -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mcrypt.exp b/test/lib/completions/mcrypt.exp
new file mode 100644
index 00000000..bfc5d2d2
--- /dev/null
+++ b/test/lib/completions/mcrypt.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mcrypt "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/md5sum.exp b/test/lib/completions/md5sum.exp
new file mode 100644
index 00000000..25290b56
--- /dev/null
+++ b/test/lib/completions/md5sum.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "md5sum "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mdecrypt.exp b/test/lib/completions/mdecrypt.exp
new file mode 100644
index 00000000..4e49ae12
--- /dev/null
+++ b/test/lib/completions/mdecrypt.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mdecrypt "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mencoder.exp b/test/lib/completions/mencoder.exp
new file mode 100644
index 00000000..169dcb71
--- /dev/null
+++ b/test/lib/completions/mencoder.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mencoder "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/minicom.exp b/test/lib/completions/minicom.exp
new file mode 100644
index 00000000..935502f1
--- /dev/null
+++ b/test/lib/completions/minicom.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "minicom -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mkdir.exp b/test/lib/completions/mkdir.exp
new file mode 100644
index 00000000..43dfec7e
--- /dev/null
+++ b/test/lib/completions/mkdir.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mkdir "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mkfifo.exp b/test/lib/completions/mkfifo.exp
new file mode 100644
index 00000000..c6343f8d
--- /dev/null
+++ b/test/lib/completions/mkfifo.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mkfifo "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mkinitrd.exp b/test/lib/completions/mkinitrd.exp
new file mode 100644
index 00000000..cfb316e5
--- /dev/null
+++ b/test/lib/completions/mkinitrd.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mkinitrd "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mkisofs.exp b/test/lib/completions/mkisofs.exp
new file mode 100644
index 00000000..ad24ea06
--- /dev/null
+++ b/test/lib/completions/mkisofs.exp
@@ -0,0 +1,48 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mkisofs "
+
+
+sync_after_int
+
+
+set test "-uid should complete uids"
+ # Try completion
+set cmd "mkisofs -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"
+ # Try completion
+set cmd "mkisofs -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
+
+
+teardown
diff --git a/test/lib/completions/mknod.exp b/test/lib/completions/mknod.exp
new file mode 100644
index 00000000..2c58cade
--- /dev/null
+++ b/test/lib/completions/mknod.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mknod "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mmsitepass.exp b/test/lib/completions/mmsitepass.exp
new file mode 100644
index 00000000..d69fa202
--- /dev/null
+++ b/test/lib/completions/mmsitepass.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mmsitepass "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/module.exp b/test/lib/completions/module.exp
new file mode 100644
index 00000000..a34667d4
--- /dev/null
+++ b/test/lib/completions/module.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "module "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mogrify.exp b/test/lib/completions/mogrify.exp
new file mode 100644
index 00000000..ef7e18ee
--- /dev/null
+++ b/test/lib/completions/mogrify.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mogrify "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/montage.exp b/test/lib/completions/montage.exp
new file mode 100644
index 00000000..736609a5
--- /dev/null
+++ b/test/lib/completions/montage.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "montage "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mount.exp b/test/lib/completions/mount.exp
new file mode 100644
index 00000000..38d93e3b
--- /dev/null
+++ b/test/lib/completions/mount.exp
@@ -0,0 +1,121 @@
+# mount completion from fstab can't be tested directly because it
+# (correctly) uses absolute paths. So we create a custom completion which
+# reads from a file in our text fixture instead.
+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"; \
+ }; \
+ complete -F _mnt mnt \
+ }
+}
+
+
+proc teardown_dummy_mnt {} {
+ assert_bash_exec {unset COMPREPLY cur}
+ assert_bash_exec {unset -f _mnt}
+ assert_bash_exec {complete -r mnt}
+}
+
+
+proc setup {} {
+ save_env
+ setup_dummy_mnt
+}
+
+
+proc teardown {} {
+ teardown_dummy_mnt
+ assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "mount "
+
+
+sync_after_int
+
+
+assert_complete_any "mount -t "
+
+
+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";}
+# This needs an explicit cword param or will output "unresolved".
+assert_complete $expected $cmd $test "/@" 20 "/"
+sync_after_int
+assert_bash_exec {PATH="$OLDPATH"; unset -v OLDPATH}
+
+
+sync_after_int
+
+
+set test "Testing internal __linux_fstab_unescape function for mount"
+# One round of slashes is for bash.
+assert_bash_exec {var=one\'two\\040three\\}
+assert_bash_exec {__linux_fstab_unescape var}
+set cmd {echo $var}
+send "$cmd\r"
+expect {
+ -ex "$cmd\r\none'two three\\" { pass $test }
+# default { fail $test }
+}
+sync_after_int
+assert_bash_exec {unset var}
+
+
+sync_after_int
+
+
+# Begin testing through mnt (see setup_dummy_mnt).
+assert_complete {/mnt/nice-test-path} {mnt /mnt/nice-test-p}
+sync_after_int
+
+assert_complete {/mnt/nice\ test-path} {mnt /mnt/nice\ test-p}
+sync_after_int
+
+assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$test-p}
+sync_after_int
+
+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\ }
+sync_after_int
+
+assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$}
+sync_after_int
+
+assert_complete {/mnt/nice\'test-path} {mnt /mnt/nice\'}
+sync_after_int
+
+assert_complete {/mnt/other\'test\ path} {mnt /mnt/other}
+sync_after_int
+
+assert_complete {Ubuntu\ Karmic} {mnt -L Ubu}
+sync_after_int
+
+assert_complete {Debian-it\'s\ awesome} {mnt -L Deb}
+sync_after_int
+
+# This does not work. Proper support for this requires smarter parsing of
+# $COMP_LINE and it's not worth doing just for mount.
+#assert_complete {$'/mnt/nice\ntest-path'} {mnt $'/mnt/nice\n}
+#sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mplayer.exp b/test/lib/completions/mplayer.exp
new file mode 100644
index 00000000..69e5d971
--- /dev/null
+++ b/test/lib/completions/mplayer.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mplayer "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/msgsnarf.exp b/test/lib/completions/msgsnarf.exp
new file mode 100644
index 00000000..74f458ff
--- /dev/null
+++ b/test/lib/completions/msgsnarf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "msgsnarf -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mtx.exp b/test/lib/completions/mtx.exp
new file mode 100644
index 00000000..a518d79f
--- /dev/null
+++ b/test/lib/completions/mtx.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mtx "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mutt.exp b/test/lib/completions/mutt.exp
new file mode 100644
index 00000000..6c727daf
--- /dev/null
+++ b/test/lib/completions/mutt.exp
@@ -0,0 +1,33 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mutt -"
+
+
+sync_after_int
+
+
+set test "mutt should complete mailboxes"
+set expected {foo/ bar/ muttrc}
+assert_complete_dir $expected "mutt -F muttrc -f =" fixtures/mutt
+
+
+set test "mutt should complete aliases"
+set expected {a1 a2}
+assert_complete_dir $expected "mutt -F muttrc -A " fixtures/mutt
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/muttng.exp b/test/lib/completions/muttng.exp
new file mode 100644
index 00000000..25a474ad
--- /dev/null
+++ b/test/lib/completions/muttng.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "muttng -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mv.exp b/test/lib/completions/mv.exp
new file mode 100644
index 00000000..f2576df7
--- /dev/null
+++ b/test/lib/completions/mv.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mv "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/mysqladmin.exp b/test/lib/completions/mysqladmin.exp
new file mode 100644
index 00000000..76381587
--- /dev/null
+++ b/test/lib/completions/mysqladmin.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "mysqladmin -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ncftp.exp b/test/lib/completions/ncftp.exp
new file mode 100644
index 00000000..ad71f226
--- /dev/null
+++ b/test/lib/completions/ncftp.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ncftp "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/netstat.exp b/test/lib/completions/netstat.exp
new file mode 100644
index 00000000..0e6414d6
--- /dev/null
+++ b/test/lib/completions/netstat.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "netstat "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/newlist.exp b/test/lib/completions/newlist.exp
new file mode 100644
index 00000000..bebf600d
--- /dev/null
+++ b/test/lib/completions/newlist.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "newlist "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/nl.exp b/test/lib/completions/nl.exp
new file mode 100644
index 00000000..02076dff
--- /dev/null
+++ b/test/lib/completions/nl.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "nl "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/nm.exp b/test/lib/completions/nm.exp
new file mode 100644
index 00000000..551f49e9
--- /dev/null
+++ b/test/lib/completions/nm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "nm "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ntpdate.exp b/test/lib/completions/ntpdate.exp
new file mode 100644
index 00000000..6a6456f4
--- /dev/null
+++ b/test/lib/completions/ntpdate.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ntpdate -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/objcopy.exp b/test/lib/completions/objcopy.exp
new file mode 100644
index 00000000..acb6539a
--- /dev/null
+++ b/test/lib/completions/objcopy.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "objcopy "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/objdump.exp b/test/lib/completions/objdump.exp
new file mode 100644
index 00000000..5eec35d6
--- /dev/null
+++ b/test/lib/completions/objdump.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "objdump "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/od.exp b/test/lib/completions/od.exp
new file mode 100644
index 00000000..5838218c
--- /dev/null
+++ b/test/lib/completions/od.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "od "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/openssl.exp b/test/lib/completions/openssl.exp
new file mode 100644
index 00000000..651e5e6d
--- /dev/null
+++ b/test/lib/completions/openssl.exp
@@ -0,0 +1,28 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set test "Tab should complete"
+ # Try completion
+set cmd "openssl "
+send "$cmd\t"
+expect {
+ -re "^$cmd\r\n.*$cmd$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}; # expect
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/p4.exp b/test/lib/completions/p4.exp
new file mode 100644
index 00000000..369d2c6b
--- /dev/null
+++ b/test/lib/completions/p4.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "p4 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pack200.exp b/test/lib/completions/pack200.exp
new file mode 100644
index 00000000..f96eff13
--- /dev/null
+++ b/test/lib/completions/pack200.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pack200 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/paste.exp b/test/lib/completions/paste.exp
new file mode 100644
index 00000000..3a4e93be
--- /dev/null
+++ b/test/lib/completions/paste.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "paste "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/patch.exp b/test/lib/completions/patch.exp
new file mode 100644
index 00000000..a44fa130
--- /dev/null
+++ b/test/lib/completions/patch.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "patch "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/perl.exp b/test/lib/completions/perl.exp
new file mode 100644
index 00000000..2199c994
--- /dev/null
+++ b/test/lib/completions/perl.exp
@@ -0,0 +1,95 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "perl "
+
+
+sync_after_int
+
+
+set test "Second argument should file complete"
+set cmd "perl foo fixtures/shared/default/f"
+send "$cmd\t"
+expect {
+ -re "^$cmd\r\nfoo +foo.d/ *\r\n/@${cmd}oo$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}
+
+
+sync_after_int
+
+
+set test "-I without space should complete directories"
+set cmd "perl -Ifixtures/shared/default/"
+send "$cmd\t"
+expect {
+ -re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}
+
+
+sync_after_int
+
+
+set test "-I with space should complete directories"
+set cmd "perl -I fixtures/shared/default/"
+send "$cmd\t"
+expect {
+ -re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}
+
+
+sync_after_int
+
+
+set test "-x without space should complete directories"
+set cmd "perl -xfixtures/shared/default/b"
+send "$cmd\t"
+expect {
+ -re "^${cmd}ar\\\\ bar.d/ *$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}
+
+
+sync_after_int
+
+
+set test "-x with space should complete directories"
+set cmd "perl -x fixtures/shared/default/b"
+send "$cmd\t"
+expect {
+ -re "^${cmd}ar\\\\ bar.d/ *$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ -re eof { unresolved "eof" }
+}
+
+
+sync_after_int
+
+
+set test "- should complete options"
+set options {
+ -0 -a -c -C -d -D -e -F -h -i -I -l -m -M -n -p -P -s -S -T -u -U -v -V -w -W -x -X
+}
+assert_complete $options "perl -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/perldoc.exp b/test/lib/completions/perldoc.exp
new file mode 100644
index 00000000..b3ff83b3
--- /dev/null
+++ b/test/lib/completions/perldoc.exp
@@ -0,0 +1,38 @@
+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"
+expect {
+ # Assuming the module `File::Path' is always installed
+ -re "\\sPath\\s" { pass "$test" }
+ # Assuming there's no perl module named `fixtures', but only our directory
+ # `test/fixtures' which is presented falsely.
+ -re "\\sfixtures/\\s" { fail "$test" }
+ -re "perldoc File::File::" { fail "$test" }
+ -re /@ { unresolved "$test" }
+ default { unresolved "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pgrep.exp b/test/lib/completions/pgrep.exp
new file mode 100644
index 00000000..63143acc
--- /dev/null
+++ b/test/lib/completions/pgrep.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pgrep "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pine.exp b/test/lib/completions/pine.exp
new file mode 100644
index 00000000..0a0c3f40
--- /dev/null
+++ b/test/lib/completions/pine.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pine "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ping.exp b/test/lib/completions/ping.exp
new file mode 100644
index 00000000..b600849b
--- /dev/null
+++ b/test/lib/completions/ping.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ping "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pkg-config.exp b/test/lib/completions/pkg-config.exp
new file mode 100644
index 00000000..477dba08
--- /dev/null
+++ b/test/lib/completions/pkg-config.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pkg-config -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pkg_deinstall.exp b/test/lib/completions/pkg_deinstall.exp
new file mode 100644
index 00000000..8f3d8c3d
--- /dev/null
+++ b/test/lib/completions/pkg_deinstall.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set pkgs [exec bash -c "cd fixtures/pkgtools/db ; compgen -d"]
+assert_complete $pkgs "pkg_deinstall "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pkg_delete.exp b/test/lib/completions/pkg_delete.exp
new file mode 100644
index 00000000..b0c1a2a5
--- /dev/null
+++ b/test/lib/completions/pkg_delete.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pkg_delete "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pkg_info.exp b/test/lib/completions/pkg_info.exp
new file mode 100644
index 00000000..3f253ccf
--- /dev/null
+++ b/test/lib/completions/pkg_info.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pkg_info "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pkill.exp b/test/lib/completions/pkill.exp
new file mode 100644
index 00000000..0333fc94
--- /dev/null
+++ b/test/lib/completions/pkill.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pkill "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/portinstall.exp b/test/lib/completions/portinstall.exp
new file mode 100644
index 00000000..d70f5db6
--- /dev/null
+++ b/test/lib/completions/portinstall.exp
@@ -0,0 +1,22 @@
+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}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_bash_exec {rm fixtures/pkgtools/ports/INDEX fixtures/pkgtools/ports/INDEX-5}
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete "bash-2.05b.007_6 bash-3.1.17 bash-completion-20060301_2 shells/bash shells/bash-completion shells/bash2" "portinstall "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/portupgrade.exp b/test/lib/completions/portupgrade.exp
new file mode 100644
index 00000000..cb583923
--- /dev/null
+++ b/test/lib/completions/portupgrade.exp
@@ -0,0 +1,21 @@
+proc setup {} {
+ assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete "a b-c-d" "portupgrade "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/povray.exp b/test/lib/completions/povray.exp
new file mode 100644
index 00000000..1efeeddb
--- /dev/null
+++ b/test/lib/completions/povray.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "povray "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pr.exp b/test/lib/completions/pr.exp
new file mode 100644
index 00000000..5d7a96c3
--- /dev/null
+++ b/test/lib/completions/pr.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pr "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/psql.exp b/test/lib/completions/psql.exp
new file mode 100644
index 00000000..56d56666
--- /dev/null
+++ b/test/lib/completions/psql.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "psql -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ptx.exp b/test/lib/completions/ptx.exp
new file mode 100644
index 00000000..2defe049
--- /dev/null
+++ b/test/lib/completions/ptx.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ptx "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pvchange.exp b/test/lib/completions/pvchange.exp
new file mode 100644
index 00000000..fd4b73d0
--- /dev/null
+++ b/test/lib/completions/pvchange.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pvchange --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pvcreate.exp b/test/lib/completions/pvcreate.exp
new file mode 100644
index 00000000..47cebf7a
--- /dev/null
+++ b/test/lib/completions/pvcreate.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pvcreate --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pvdisplay.exp b/test/lib/completions/pvdisplay.exp
new file mode 100644
index 00000000..151064cd
--- /dev/null
+++ b/test/lib/completions/pvdisplay.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pvdisplay --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pvmove.exp b/test/lib/completions/pvmove.exp
new file mode 100644
index 00000000..81c05e98
--- /dev/null
+++ b/test/lib/completions/pvmove.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pvmove --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pvremove.exp b/test/lib/completions/pvremove.exp
new file mode 100644
index 00000000..dd145bf6
--- /dev/null
+++ b/test/lib/completions/pvremove.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pvremove --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pvs.exp b/test/lib/completions/pvs.exp
new file mode 100644
index 00000000..6e5527e1
--- /dev/null
+++ b/test/lib/completions/pvs.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pvs --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/pvscan.exp b/test/lib/completions/pvscan.exp
new file mode 100644
index 00000000..e92cdbe0
--- /dev/null
+++ b/test/lib/completions/pvscan.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "pvscan --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/python.exp b/test/lib/completions/python.exp
new file mode 100644
index 00000000..c9d70b43
--- /dev/null
+++ b/test/lib/completions/python.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "python "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/qrunner.exp b/test/lib/completions/qrunner.exp
new file mode 100644
index 00000000..b8fcf191
--- /dev/null
+++ b/test/lib/completions/qrunner.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "qrunner -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/querybts.exp b/test/lib/completions/querybts.exp
new file mode 100644
index 00000000..dc75cd62
--- /dev/null
+++ b/test/lib/completions/querybts.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "querybts --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rcs.exp b/test/lib/completions/rcs.exp
new file mode 100644
index 00000000..19ae4d50
--- /dev/null
+++ b/test/lib/completions/rcs.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rcs "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rcsdiff.exp b/test/lib/completions/rcsdiff.exp
new file mode 100644
index 00000000..8383cdb9
--- /dev/null
+++ b/test/lib/completions/rcsdiff.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rcsdiff "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rdict.exp b/test/lib/completions/rdict.exp
new file mode 100644
index 00000000..aa132617
--- /dev/null
+++ b/test/lib/completions/rdict.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rdict --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/readelf.exp b/test/lib/completions/readelf.exp
new file mode 100644
index 00000000..a084a41e
--- /dev/null
+++ b/test/lib/completions/readelf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "readelf --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/readonly.exp b/test/lib/completions/readonly.exp
new file mode 100644
index 00000000..84be3c96
--- /dev/null
+++ b/test/lib/completions/readonly.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "readonly BASH_ARG"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/remove_members.exp b/test/lib/completions/remove_members.exp
new file mode 100644
index 00000000..63d6a70e
--- /dev/null
+++ b/test/lib/completions/remove_members.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "remove_members --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/removepkg.exp b/test/lib/completions/removepkg.exp
new file mode 100644
index 00000000..7cf98805
--- /dev/null
+++ b/test/lib/completions/removepkg.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "removepkg "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/renice.exp b/test/lib/completions/renice.exp
new file mode 100644
index 00000000..c91e0212
--- /dev/null
+++ b/test/lib/completions/renice.exp
@@ -0,0 +1,42 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set test "Tab should show complete process ids"
+ # Try completion
+set cmd "renice 1"
+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 "Tab should show complete process group ids"
+ # Try completion
+set cmd "renice -g "
+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
+
+
+teardown
diff --git a/test/lib/completions/reportbug.exp b/test/lib/completions/reportbug.exp
new file mode 100644
index 00000000..1f66df2c
--- /dev/null
+++ b/test/lib/completions/reportbug.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "reportbug --m"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ri.exp b/test/lib/completions/ri.exp
new file mode 100644
index 00000000..160dc9a7
--- /dev/null
+++ b/test/lib/completions/ri.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ri "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rlog.exp b/test/lib/completions/rlog.exp
new file mode 100644
index 00000000..cbc06857
--- /dev/null
+++ b/test/lib/completions/rlog.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rlog "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rm.exp b/test/lib/completions/rm.exp
new file mode 100644
index 00000000..ae670e83
--- /dev/null
+++ b/test/lib/completions/rm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rm "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rmdir.exp b/test/lib/completions/rmdir.exp
new file mode 100644
index 00000000..2b23a9c5
--- /dev/null
+++ b/test/lib/completions/rmdir.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rmdir "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rmlist.exp b/test/lib/completions/rmlist.exp
new file mode 100644
index 00000000..91519ee8
--- /dev/null
+++ b/test/lib/completions/rmlist.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rmlist -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rpcdebug.exp b/test/lib/completions/rpcdebug.exp
new file mode 100644
index 00000000..8629c947
--- /dev/null
+++ b/test/lib/completions/rpcdebug.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rpcdebug -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rpm.exp b/test/lib/completions/rpm.exp
new file mode 100644
index 00000000..3ed154a9
--- /dev/null
+++ b/test/lib/completions/rpm.exp
@@ -0,0 +1,29 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rpm "
+
+
+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
+
+
+teardown
diff --git a/test/lib/completions/rsync.exp b/test/lib/completions/rsync.exp
new file mode 100644
index 00000000..fb301a35
--- /dev/null
+++ b/test/lib/completions/rsync.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rsync "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/rtcwake.exp b/test/lib/completions/rtcwake.exp
new file mode 100644
index 00000000..0b9a974b
--- /dev/null
+++ b/test/lib/completions/rtcwake.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "rtcwake "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sbcl-mt.exp b/test/lib/completions/sbcl-mt.exp
new file mode 100644
index 00000000..45e81f79
--- /dev/null
+++ b/test/lib/completions/sbcl-mt.exp
@@ -0,0 +1,20 @@
+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/"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sbcl.exp b/test/lib/completions/sbcl.exp
new file mode 100644
index 00000000..b68b2dce
--- /dev/null
+++ b/test/lib/completions/sbcl.exp
@@ -0,0 +1,20 @@
+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/"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/scp.exp b/test/lib/completions/scp.exp
new file mode 100644
index 00000000..efe2b686
--- /dev/null
+++ b/test/lib/completions/scp.exp
@@ -0,0 +1,121 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {
+ /BASH_LINENO=/d
+ /BASH_SOURCE=/d
+ /OLDPWD=/d
+ }
+}; # teardown()
+
+
+setup
+
+
+set test "Tab should complete remote pwd"
+set host bash_completion
+
+ # Retrieving home directory (host_pwd) from ssh-host `bash_completion'
+ # yields error?
+if {
+ [catch {
+ exec -- ssh -o "Batchmode yes" -o "ConnectTimeout 1" $host pwd 2>> /dev/null
+ } host_pwd]
+} {
+ # Yes, retrieving pwd from ssh yields error; reset `host_pwd'
+ # Indicate host pwd is unknown and test is unsupported
+ # NOTE: To support this test, set the hostname "bash_completion"
+ # in `$HOME/.ssh/config' or `/etc/ssh_config'
+ set host_pwd ""
+ unsupported $test
+}; # if
+
+
+ # Try completion
+set cmd "scp $host:"
+send "$cmd\t"
+sync_after_tab
+expect {
+ -re "^$cmd$host_pwd.*$" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+}; # expect
+
+
+sync_after_int
+
+
+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
+set expected {}
+foreach host [get_hosts] {
+ lappend expected "$host:"
+}; # foreach
+lappend expected 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
+
+
+sync_after_int
+
+
+set test "-F without space shouldn't error"
+ # Try completion
+set cmd "scp -F"
+send "$cmd\t "
+expect {
+ -re "^${cmd}bash: option requires an argument -- F" { fail "$test" }
+ -re "^$cmd\r\n.*\r\n/@" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test "Config file containing space should work"
+ # Build string list of expected completions
+ # Get hostnames and give them a colon (:) suffix
+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:
+ # 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]} {
+ expect {
+ -re $prompt { 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
+assert_bash_exec {cd "$TESTDIR"}
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/screen.exp b/test/lib/completions/screen.exp
new file mode 100644
index 00000000..985862c1
--- /dev/null
+++ b/test/lib/completions/screen.exp
@@ -0,0 +1,52 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}; # teardown()
+
+
+setup
+
+
+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"}
+
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sed.exp b/test/lib/completions/sed.exp
new file mode 100644
index 00000000..8764cfb8
--- /dev/null
+++ b/test/lib/completions/sed.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {sed --help} "" "" "unsupported"]} {
+ assert_complete_any "sed --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/seq.exp b/test/lib/completions/seq.exp
new file mode 100644
index 00000000..b5333ef9
--- /dev/null
+++ b/test/lib/completions/seq.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "seq --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/service.exp b/test/lib/completions/service.exp
new file mode 100644
index 00000000..917c5dcb
--- /dev/null
+++ b/test/lib/completions/service.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "service "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/set.exp b/test/lib/completions/set.exp
new file mode 100644
index 00000000..2b2d40e9
--- /dev/null
+++ b/test/lib/completions/set.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "set no"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sftp.exp b/test/lib/completions/sftp.exp
new file mode 100644
index 00000000..24c37cb5
--- /dev/null
+++ b/test/lib/completions/sftp.exp
@@ -0,0 +1,77 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {
+ /BASH_LINENO=/d
+ /BASH_SOURCE=/d
+ /OLDPWD=/d
+ }
+}; # teardown()
+
+
+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
+
+
+sync_after_int
+
+
+set test "-F without space shouldn't error"
+ # Try completion
+set cmd "sftp -F"
+send "$cmd\t "
+expect {
+ -re "^${cmd}bash: option requires an argument -- F" { fail "$test" }
+ -re "^$cmd\r\n.*\r\n/@" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}; # expect
+
+
+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
+
+
+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"}
+
+
+teardown
diff --git a/test/lib/completions/sha1sum.exp b/test/lib/completions/sha1sum.exp
new file mode 100644
index 00000000..17519087
--- /dev/null
+++ b/test/lib/completions/sha1sum.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "sha1sum --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/shar.exp b/test/lib/completions/shar.exp
new file mode 100644
index 00000000..7ace9d6e
--- /dev/null
+++ b/test/lib/completions/shar.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "shar --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sitecopy.exp b/test/lib/completions/sitecopy.exp
new file mode 100644
index 00000000..49b78918
--- /dev/null
+++ b/test/lib/completions/sitecopy.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "sitecopy --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/smartctl.exp b/test/lib/completions/smartctl.exp
new file mode 100644
index 00000000..a9eeb956
--- /dev/null
+++ b/test/lib/completions/smartctl.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "smartctl --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/snownews.exp b/test/lib/completions/snownews.exp
new file mode 100644
index 00000000..7502e587
--- /dev/null
+++ b/test/lib/completions/snownews.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "snownews --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sort.exp b/test/lib/completions/sort.exp
new file mode 100644
index 00000000..20516cc8
--- /dev/null
+++ b/test/lib/completions/sort.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "sort --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/split.exp b/test/lib/completions/split.exp
new file mode 100644
index 00000000..b74da369
--- /dev/null
+++ b/test/lib/completions/split.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {split --help} "" "" "unsupported"]} {
+ assert_complete_any "split --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/spovray.exp b/test/lib/completions/spovray.exp
new file mode 100644
index 00000000..30d81853
--- /dev/null
+++ b/test/lib/completions/spovray.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "spovray "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ssh.exp b/test/lib/completions/ssh.exp
new file mode 100644
index 00000000..91955c1d
--- /dev/null
+++ b/test/lib/completions/ssh.exp
@@ -0,0 +1,93 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {
+ /BASH_LINENO=/d
+ /BASH_SOURCE=/d
+ /OLDPWD=/d
+ }
+}; # teardown()
+
+
+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$"
+expect {
+ -re $expected { pass "$test" }
+ -re $prompt { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}; # expect
+sync_after_int $prompt
+assert_bash_exec {cd "$TESTDIR"}
+
+
+sync_after_int
+
+
+set test "-F without space shouldn't error"
+ # Try completion
+set cmd "ssh -F"
+send "$cmd\t "
+set expected "^$cmd $"
+expect {
+ -re "^${cmd}bash: option requires an argument -- F" { fail "$test" }
+ -re "^$cmd\r\n.*\r\n/@" { pass "$test" }
+ -re /@ { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test "First argument shouldn't complete with commands"
+# NOTE: This test assumes there's a command "bash" and no host named "bash"
+set cmd "ssh bas"
+assert_complete [get_known_hosts "bas"] $cmd $test
+
+
+sync_after_int
+
+
+set test "First argument should complete partial hostname"
+assert_complete_partial [get_hosts] ssh "" $test /@ 20 \
+ [list "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"}
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sshmitm.exp b/test/lib/completions/sshmitm.exp
new file mode 100644
index 00000000..b8f8a2c9
--- /dev/null
+++ b/test/lib/completions/sshmitm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "sshmitm -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sshow.exp b/test/lib/completions/sshow.exp
new file mode 100644
index 00000000..36a6cc2c
--- /dev/null
+++ b/test/lib/completions/sshow.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "sshow -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/strace.exp b/test/lib/completions/strace.exp
new file mode 100644
index 00000000..55004d20
--- /dev/null
+++ b/test/lib/completions/strace.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "strace -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/strip.exp b/test/lib/completions/strip.exp
new file mode 100644
index 00000000..46d9f362
--- /dev/null
+++ b/test/lib/completions/strip.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "strip --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sudo.exp b/test/lib/completions/sudo.exp
new file mode 100644
index 00000000..1299a6da
--- /dev/null
+++ b/test/lib/completions/sudo.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete "fixtures/shared/default/foo.d/" "sudo cd fixtures/shared/default/fo"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/svk.exp b/test/lib/completions/svk.exp
new file mode 100644
index 00000000..a08674dc
--- /dev/null
+++ b/test/lib/completions/svk.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "svk "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/svn.exp b/test/lib/completions/svn.exp
new file mode 100644
index 00000000..fe40d6f7
--- /dev/null
+++ b/test/lib/completions/svn.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "svn "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/svnadmin.exp b/test/lib/completions/svnadmin.exp
new file mode 100644
index 00000000..35e07021
--- /dev/null
+++ b/test/lib/completions/svnadmin.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "svnadmin "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/svnlook.exp b/test/lib/completions/svnlook.exp
new file mode 100644
index 00000000..33b67052
--- /dev/null
+++ b/test/lib/completions/svnlook.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "svnlook "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sync_members.exp b/test/lib/completions/sync_members.exp
new file mode 100644
index 00000000..4cb84ad8
--- /dev/null
+++ b/test/lib/completions/sync_members.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "sync_members --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/sysctl.exp b/test/lib/completions/sysctl.exp
new file mode 100644
index 00000000..e1866f55
--- /dev/null
+++ b/test/lib/completions/sysctl.exp
@@ -0,0 +1,22 @@
+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
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tac.exp b/test/lib/completions/tac.exp
new file mode 100644
index 00000000..21230052
--- /dev/null
+++ b/test/lib/completions/tac.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "tac --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tail.exp b/test/lib/completions/tail.exp
new file mode 100644
index 00000000..c8a82d97
--- /dev/null
+++ b/test/lib/completions/tail.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {tail --help} "" "" "unsupported"]} {
+ assert_complete_any "tail --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tar.exp b/test/lib/completions/tar.exp
new file mode 100644
index 00000000..43c60ff9
--- /dev/null
+++ b/test/lib/completions/tar.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "tar "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tcpkill.exp b/test/lib/completions/tcpkill.exp
new file mode 100644
index 00000000..e8cc9c10
--- /dev/null
+++ b/test/lib/completions/tcpkill.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "tcpkill -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tcpnice.exp b/test/lib/completions/tcpnice.exp
new file mode 100644
index 00000000..44bb59c6
--- /dev/null
+++ b/test/lib/completions/tcpnice.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "tcpnice -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tee.exp b/test/lib/completions/tee.exp
new file mode 100644
index 00000000..c25057ba
--- /dev/null
+++ b/test/lib/completions/tee.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "tee "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/texindex.exp b/test/lib/completions/texindex.exp
new file mode 100644
index 00000000..d5b8cd77
--- /dev/null
+++ b/test/lib/completions/texindex.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "texindex --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tightvncviewer.exp b/test/lib/completions/tightvncviewer.exp
new file mode 100644
index 00000000..6eba24c2
--- /dev/null
+++ b/test/lib/completions/tightvncviewer.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "tightvncviewer "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/time.exp b/test/lib/completions/time.exp
new file mode 100644
index 00000000..b114318b
--- /dev/null
+++ b/test/lib/completions/time.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "time set"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/touch.exp b/test/lib/completions/touch.exp
new file mode 100644
index 00000000..f0960ef7
--- /dev/null
+++ b/test/lib/completions/touch.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {touch --help} "" "" "unsupported"]} {
+ assert_complete_any "touch --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/tr.exp b/test/lib/completions/tr.exp
new file mode 100644
index 00000000..68b11a36
--- /dev/null
+++ b/test/lib/completions/tr.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {tr --help} "" "" "unsupported"]} {
+ assert_complete_any "tr --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/unace.exp b/test/lib/completions/unace.exp
new file mode 100644
index 00000000..0afbaafb
--- /dev/null
+++ b/test/lib/completions/unace.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "unace -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/uname.exp b/test/lib/completions/uname.exp
new file mode 100644
index 00000000..2179dafd
--- /dev/null
+++ b/test/lib/completions/uname.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {uname --help} "" "" "unsupported"]} {
+ assert_complete_any "uname --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/unexpand.exp b/test/lib/completions/unexpand.exp
new file mode 100644
index 00000000..31822561
--- /dev/null
+++ b/test/lib/completions/unexpand.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {unexpand --help} "" "" "unsupported"]} {
+ assert_complete_any "unexpand --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/uniq.exp b/test/lib/completions/uniq.exp
new file mode 100644
index 00000000..20dbcfac
--- /dev/null
+++ b/test/lib/completions/uniq.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {uniq --help} "" "" "unsupported"]} {
+ assert_complete_any "uniq --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/units.exp b/test/lib/completions/units.exp
new file mode 100644
index 00000000..a40b5f3f
--- /dev/null
+++ b/test/lib/completions/units.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {units --help} "" "" "unsupported"]} {
+ assert_complete_any "units --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/unpack200.exp b/test/lib/completions/unpack200.exp
new file mode 100644
index 00000000..845701dd
--- /dev/null
+++ b/test/lib/completions/unpack200.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "unpack200 "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/unrar.exp b/test/lib/completions/unrar.exp
new file mode 100644
index 00000000..e66e3c8b
--- /dev/null
+++ b/test/lib/completions/unrar.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "unrar -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/unset.exp b/test/lib/completions/unset.exp
new file mode 100644
index 00000000..a5e7fc9b
--- /dev/null
+++ b/test/lib/completions/unset.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "unset BASH_ARG"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/unshunt.exp b/test/lib/completions/unshunt.exp
new file mode 100644
index 00000000..964cac68
--- /dev/null
+++ b/test/lib/completions/unshunt.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "unshunt -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/update-alternatives.exp b/test/lib/completions/update-alternatives.exp
new file mode 100644
index 00000000..10ff4e6d
--- /dev/null
+++ b/test/lib/completions/update-alternatives.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "update-alternatives --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/update-rc.d.exp b/test/lib/completions/update-rc.d.exp
new file mode 100644
index 00000000..9c2c2464
--- /dev/null
+++ b/test/lib/completions/update-rc.d.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "update-rc.d -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/urlsnarf.exp b/test/lib/completions/urlsnarf.exp
new file mode 100644
index 00000000..c5b26922
--- /dev/null
+++ b/test/lib/completions/urlsnarf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "urlsnarf -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vdir.exp b/test/lib/completions/vdir.exp
new file mode 100644
index 00000000..b525c382
--- /dev/null
+++ b/test/lib/completions/vdir.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vdir "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgcfgbackup.exp b/test/lib/completions/vgcfgbackup.exp
new file mode 100644
index 00000000..19ceeeca
--- /dev/null
+++ b/test/lib/completions/vgcfgbackup.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgcfgbackup -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgcfgrestore.exp b/test/lib/completions/vgcfgrestore.exp
new file mode 100644
index 00000000..e1c3c3b9
--- /dev/null
+++ b/test/lib/completions/vgcfgrestore.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgcfgrestore -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgchange.exp b/test/lib/completions/vgchange.exp
new file mode 100644
index 00000000..645eedb4
--- /dev/null
+++ b/test/lib/completions/vgchange.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgchange -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgck.exp b/test/lib/completions/vgck.exp
new file mode 100644
index 00000000..67209b15
--- /dev/null
+++ b/test/lib/completions/vgck.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgck -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgconvert.exp b/test/lib/completions/vgconvert.exp
new file mode 100644
index 00000000..065c4828
--- /dev/null
+++ b/test/lib/completions/vgconvert.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgconvert -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgcreate.exp b/test/lib/completions/vgcreate.exp
new file mode 100644
index 00000000..7c324e62
--- /dev/null
+++ b/test/lib/completions/vgcreate.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgcreate -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgdisplay.exp b/test/lib/completions/vgdisplay.exp
new file mode 100644
index 00000000..b6bc9125
--- /dev/null
+++ b/test/lib/completions/vgdisplay.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgdisplay -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgexport.exp b/test/lib/completions/vgexport.exp
new file mode 100644
index 00000000..2ad4230e
--- /dev/null
+++ b/test/lib/completions/vgexport.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgexport -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgextend.exp b/test/lib/completions/vgextend.exp
new file mode 100644
index 00000000..18a491d2
--- /dev/null
+++ b/test/lib/completions/vgextend.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgextend -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgimport.exp b/test/lib/completions/vgimport.exp
new file mode 100644
index 00000000..e4568f3b
--- /dev/null
+++ b/test/lib/completions/vgimport.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgimport -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgmerge.exp b/test/lib/completions/vgmerge.exp
new file mode 100644
index 00000000..8ba5e893
--- /dev/null
+++ b/test/lib/completions/vgmerge.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgmerge -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgmknodes.exp b/test/lib/completions/vgmknodes.exp
new file mode 100644
index 00000000..d24552f0
--- /dev/null
+++ b/test/lib/completions/vgmknodes.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgmknodes -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgreduce.exp b/test/lib/completions/vgreduce.exp
new file mode 100644
index 00000000..887ba8de
--- /dev/null
+++ b/test/lib/completions/vgreduce.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgreduce -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgremove.exp b/test/lib/completions/vgremove.exp
new file mode 100644
index 00000000..26dadf95
--- /dev/null
+++ b/test/lib/completions/vgremove.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgremove -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgrename.exp b/test/lib/completions/vgrename.exp
new file mode 100644
index 00000000..8ddaa758
--- /dev/null
+++ b/test/lib/completions/vgrename.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgrename -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgs.exp b/test/lib/completions/vgs.exp
new file mode 100644
index 00000000..a27e3650
--- /dev/null
+++ b/test/lib/completions/vgs.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgs -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgscan.exp b/test/lib/completions/vgscan.exp
new file mode 100644
index 00000000..4bb8c35e
--- /dev/null
+++ b/test/lib/completions/vgscan.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgscan -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vgsplit.exp b/test/lib/completions/vgsplit.exp
new file mode 100644
index 00000000..54e7034f
--- /dev/null
+++ b/test/lib/completions/vgsplit.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vgsplit -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/vncviewer.exp b/test/lib/completions/vncviewer.exp
new file mode 100644
index 00000000..3d47f49f
--- /dev/null
+++ b/test/lib/completions/vncviewer.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {
+ /declare -f _vncviewer_bootstrap/d
+ }
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "vncviewer "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/wc.exp b/test/lib/completions/wc.exp
new file mode 100644
index 00000000..8ad2bf8d
--- /dev/null
+++ b/test/lib/completions/wc.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {wc --help} "" "" "unsupported"]} {
+ assert_complete_any "wc --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/webmitm.exp b/test/lib/completions/webmitm.exp
new file mode 100644
index 00000000..1d48a3a6
--- /dev/null
+++ b/test/lib/completions/webmitm.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "webmitm -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/wget.exp b/test/lib/completions/wget.exp
new file mode 100644
index 00000000..245b27be
--- /dev/null
+++ b/test/lib/completions/wget.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "wget --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/who.exp b/test/lib/completions/who.exp
new file mode 100644
index 00000000..73928ef7
--- /dev/null
+++ b/test/lib/completions/who.exp
@@ -0,0 +1,22 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+if {[assert_exec {who --help} "" "" "unsupported"]} {
+ assert_complete_any "who --"
+}; # if
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/withlist.exp b/test/lib/completions/withlist.exp
new file mode 100644
index 00000000..6310466d
--- /dev/null
+++ b/test/lib/completions/withlist.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "withlist --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/wol.exp b/test/lib/completions/wol.exp
new file mode 100644
index 00000000..84a2d88d
--- /dev/null
+++ b/test/lib/completions/wol.exp
@@ -0,0 +1,29 @@
+proc setup {} {
+ # See fixtures/shared/bin/{arp,ifconfig}
+ assert_bash_exec {OLDPATH="$PATH"; PATH="$TESTDIR/fixtures/shared/bin:$PATH";}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+ assert_bash_exec {PATH="$OLDPATH"; unset -v OLDPATH}
+}; # teardown()
+
+
+setup
+
+
+assert_complete "00:00:00:00:00:00 11:11:11:11:11:11 22:22:22:22:22:22 33:33:33:33:33:33" "wol "
+
+
+sync_after_int
+
+
+assert_complete "00:00:00:00:00:00" "wol 00:"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/wtf.exp b/test/lib/completions/wtf.exp
new file mode 100644
index 00000000..8250becc
--- /dev/null
+++ b/test/lib/completions/wtf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "wtf "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/wvdial.exp b/test/lib/completions/wvdial.exp
new file mode 100644
index 00000000..8d4669de
--- /dev/null
+++ b/test/lib/completions/wvdial.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "wvdial -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xhost.exp b/test/lib/completions/xhost.exp
new file mode 100644
index 00000000..aeceadb6
--- /dev/null
+++ b/test/lib/completions/xhost.exp
@@ -0,0 +1,100 @@
+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
+
+
+sync_after_int
+
+
+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"] {
+ 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
+
+
+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"] {
+ lappend hosts "+$h"
+}; # foreach
+assert_complete $hosts "xhost \+" $test
+
+
+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"] {
+ 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"
+
+
+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"] {
+ lappend hosts "-$h"
+}; # foreach
+assert_complete $hosts "xhost -" $test
+
+
+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"] {
+ 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
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xmllint.exp b/test/lib/completions/xmllint.exp
new file mode 100644
index 00000000..15451471
--- /dev/null
+++ b/test/lib/completions/xmllint.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "xmllint "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xmlwf.exp b/test/lib/completions/xmlwf.exp
new file mode 100644
index 00000000..a996d458
--- /dev/null
+++ b/test/lib/completions/xmlwf.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "xmlwf "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xmms.exp b/test/lib/completions/xmms.exp
new file mode 100644
index 00000000..c4ad64e8
--- /dev/null
+++ b/test/lib/completions/xmms.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "xmms --"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xpovray.exp b/test/lib/completions/xpovray.exp
new file mode 100644
index 00000000..92cc903d
--- /dev/null
+++ b/test/lib/completions/xpovray.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "xpovray "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xrandr.exp b/test/lib/completions/xrandr.exp
new file mode 100644
index 00000000..649ed43b
--- /dev/null
+++ b/test/lib/completions/xrandr.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "xrandr "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xsltproc.exp b/test/lib/completions/xsltproc.exp
new file mode 100644
index 00000000..2470c22e
--- /dev/null
+++ b/test/lib/completions/xsltproc.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "xsltproc "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xvnc4viewer.exp b/test/lib/completions/xvnc4viewer.exp
new file mode 100644
index 00000000..3456c3e7
--- /dev/null
+++ b/test/lib/completions/xvnc4viewer.exp
@@ -0,0 +1,45 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+set test "Tab should complete options"
+set options {
+ -AcceptClipboard -AutoSelect -DebugDelay -display
+ -DotWhenNoCursor -FullColor -FullColour -FullScreen
+ -geometry -help -listen -Log
+ -LowColourLevel -MenuKey -name -Parent
+ -passwd -PasswordFile -PointerEventInterval -PreferredEncoding
+ -SendClipboard -SendPrimary -Shared -UseLocalCursor
+ -via -ViewOnly -WMDecorationHeight -WMDecorationWidth
+ -ZlibLevel
+}
+assert_complete $options {vncviewer -}
+
+
+sync_after_int
+
+
+set expected {hextile raw zrle}
+assert_complete $expected "xvnc4viewer -PreferredEncoding "
+
+
+sync_after_int
+
+
+set expected {hextile raw zrle}
+assert_complete $expected "xvnc4viewer --preferredencoding "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/xz.exp b/test/lib/completions/xz.exp
new file mode 100644
index 00000000..820b0689
--- /dev/null
+++ b/test/lib/completions/xz.exp
@@ -0,0 +1,33 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "xz "
+
+
+sync_after_int
+
+
+assert_complete "a/ bashcomp.lzma bashcomp.tar.xz bashcomp.tlz bashcomp.xz" \
+ "xz -d fixtures/xz/"
+
+
+sync_after_int
+
+
+assert_complete "a/ bashcomp.tar" "xz fixtures/xz/"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ypcat.exp b/test/lib/completions/ypcat.exp
new file mode 100644
index 00000000..f1bd0c0e
--- /dev/null
+++ b/test/lib/completions/ypcat.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ypcat "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/ypmatch.exp b/test/lib/completions/ypmatch.exp
new file mode 100644
index 00000000..f1695f67
--- /dev/null
+++ b/test/lib/completions/ypmatch.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "ypmatch foo "
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/yum-arch.exp b/test/lib/completions/yum-arch.exp
new file mode 100644
index 00000000..defb7bf4
--- /dev/null
+++ b/test/lib/completions/yum-arch.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "yum-arch -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/completions/yum.exp b/test/lib/completions/yum.exp
new file mode 100644
index 00000000..09d7282c
--- /dev/null
+++ b/test/lib/completions/yum.exp
@@ -0,0 +1,20 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified
+}; # teardown()
+
+
+setup
+
+
+assert_complete_any "yum -"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/lib/library.exp b/test/lib/library.exp
new file mode 100644
index 00000000..c76d9854
--- /dev/null
+++ b/test/lib/library.exp
@@ -0,0 +1,908 @@
+ # 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 textutil::string
+
+
+
+# Execute a bash command and make sure the exit status is successful.
+# If not, output the error message.
+# @param string $cmd Bash command line to execute. If empty string (""), the
+# exit status of the previously executed bash command will be
+# checked; specify `title' to adorn the error message.
+# @param string $title (optional) Command title. If empty, `cmd' is used.
+# @param string $prompt (optional) Bash prompt. Default is "/@"
+# @param mixed $out (optional) Reference to (tcl) variable to hold output.
+# If variable equals -1 (default) the bash command is expected
+# to return no output. If variable equals 0, any output
+# from the bash command is disregarded.
+proc assert_bash_exec {{aCmd ""} {title ""} {prompt /@} {out -1}} {
+ if {$out != 0 && $out != -1} {upvar $out results}
+ 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
+ # Remove $prompt suffix from output
+ set results [
+ string range $results 0 [
+ expr [string length $results] - [string length $prompt] - 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
+
+ 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()
+
+
+# Test `type ...' in bash
+# Indicate "unsupported" if `type' exits with error status.
+# @param string $command Command to locate
+proc assert_bash_type {command} {
+ set test "$command should be available in bash"
+ set cmd "type $command &> /dev/null && echo -n 0 || echo -n 1"
+ send "$cmd\r"
+ expect "$cmd\r\n"
+ 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}} {
+ 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" }
+ }
+ } else {
+ fail "$test"
+ }
+ }
+}
+
+
+proc assert_bash_list_dir {expected cmd dir {test ""} {prompt /@} {size 20}} {
+ set prompt "/$dir/@"
+ assert_bash_exec "cd $dir" "" $prompt
+ assert_bash_list $expected $cmd $test $prompt $size
+ 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.
+# @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 ""}} {
+ if {[llength $expected] == 0} {
+ assert_no_complete $cmd $test
+ } 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()
+
+
+# @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.
+# 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 ""}} {
+ 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
+ } else {
+ # No, $cword not specified;
+ # Check if last argument is really an-argument-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.
+ # 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
+ return $cmd2
+}; # _remove_cword_from_cmd()
+
+
+# Escape regexp special characters
+proc _escape_regexp_chars {var} {
+ upvar $var str
+ regsub -all {([\^$+*?.|(){}[\]\\])} $str {\\\1} str
+}
+
+# Make sure any completions are returned
+proc assert_complete_any {cmd {test ""} {prompt /@}} {
+ if {$test == ""} {set test "$cmd should show completions"}
+ send "$cmd\t"
+ expect -ex "$cmd"
+ _escape_regexp_chars cmd
+ expect {
+ -timeout 1
+ # Match completions, multiple words
+ # NOTE: The `\S*' (zero or more non-whitespace characters) matches a
+ # longest common prefix of the completions shown.
+ # E.g. `fmt -' becomes `fmt --' (two dashes) when completing
+ -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" }
+ timeout {
+ expect {
+ # Match completion, single word. This word is shown on the
+ # same line as the command.
+ -re "^\\w+ $" { pass "$test" }
+ # Try matching multiple words again, with new timeout
+ -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" }
+ }
+ }
+ -re $prompt { unresolved "$test at prompt" }
+ eof { unresolved "eof" }
+ }; # expect
+}; # assert_complete_any()
+
+
+# Make sure the expected files are returned by TAB-completing the
+# specified command in the specified subdirectory.
+# @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()
+# @result boolean True if successful, False if not
+proc assert_complete_dir {expected cmd dir {test ""} {size 20} {cword ""}} {
+ set prompt "/$dir/@"
+ assert_bash_exec "cd $dir" "" $prompt
+ assert_complete $expected $cmd $test $prompt $size $cword
+ sync_after_int $prompt
+ assert_bash_exec {cd "$TESTDIR"}
+}; # assert_complete_dir
+
+
+
+# Make sure a partial argument is completed.
+# A completion is tried with `$partial', or if this is empty, the first
+# character of the first item of `$expected'. Only the items from $expected,
+# starting with this character are then expected as completions.
+# @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 ""}} {
+ if {$test == ""} {set test "$cmd should complete partial argument"}
+ if {[llength $expected] == 0} {
+ unresolved "$test"
+ } else {
+ set pick {}
+ # Make sure expected items are unique
+ set expected [lsort -unique $expected]
+ foreach item $expected {
+ if {$partial == ""} {set partial [string range $item 0 0]}
+ # 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()
+
+
+# See also: bash_completion._ltrim_colon_completions
+proc _ltrim_colon_completions {cword items} {
+ upvar 1 $cword cword_out
+ upvar 1 $items items_out
+ # 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 && (
+ [lindex $::BASH_VERSINFO 0] < 4 ||
+ ([lindex $::BASH_VERSINFO 0] >= 4 && [string first ":" $::COMP_WORDBREAKS] > -1)
+ )
+ } {
+ for {set i 0} {$i < [llength $items_out]} {incr i} {
+ set item [lindex $items_out $i]
+ if {[string first $cword_out $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()
+
+
+# Make sure the bash environment hasn't changed between now and the last call
+# to `save_env()'.
+# @param string $sed Sed commands to preprocess diff output.
+# Example calls:
+#
+# # Replace `COMP_PATH=.*' with `COMP_PATH=PATH'
+# assert_env_unmodified {s/COMP_PATH=.*/COMP_PATH=PATH/}
+#
+# # Remove lines containing `OLDPWD='
+# assert_env_unmodified {/OLDPWD=/d}
+#
+# @param string $file Filename to generate environment save file from. See
+# `gen_env_filename()'.
+# @param string $diff Expected diff output (after being processed by $sed)
+# @see save_env()
+proc assert_env_unmodified {{sed ""} {file ""} {diff ""}} {
+ set test "Environment should not be modified"
+ _save_env [gen_env_filename $file 2]
+
+ # Prepare sed script
+
+ # Escape special bash characters ("\)
+ regsub -all {([\"\\])} $sed {\\\1} sed; #"# (fix Vim syntax highlighting)
+ # Escape newlines
+ regsub -all {\n} [string trim $sed] "\r\n" sed
+
+ # Prepare diff script
+
+ # If diff is filled, escape newlines and make sure it ends with a newline
+ if {[string length [string trim $diff]]} {
+ regsub -all {\n} [string trim $diff] "\r\n" diff
+ append diff "\r\n"
+ } else {
+ set diff ""
+ }; # if
+
+ # Execute diff
+
+ # NOTE: The dummy argument 'LAST-ARG' sets bash variable $_ (last argument) to
+ # 'LAST-ARG' so that $_ doesn't mess up the diff (as it would if $_
+ # was the (possibly multi-lined) sed script).
+ set cmd "diff_env \"[gen_env_filename $file 1]\" \"[gen_env_filename $file 2]\" \"$sed\" LAST-ARG"
+ send "$cmd\r"
+ expect "LAST-ARG\r\n"
+
+ expect {
+ -re "^$diff[wd]@$" { pass "$test" }
+ -re [wd]@ {
+ fail "$test"
+
+ # Show diff to user
+
+ set diff $expect_out(buffer)
+ # 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.
+# Fail the test with status UNSUPPORTED if Tcl fails with error "POSIX/ENOENT
+# (No such file or directory)", or with the given Tcl failure status command
+# (default "unresolved") if other error occurs.
+# NOTE: Further tests are assumed if executing the command is successful. The
+# test isn't immediately declared to have PASSED if the command is
+# executed successful.
+# @param string $command
+# @param string $stdout (optional) Reference to variable to hold stdout.
+# @param string $test (optional) Test title
+# @param string $failcmd (optional, default "unresolved") Failure command
+# @see assert_bash_exec()
+proc assert_exec {cmd {stdout ''} {test ''} {failcmd "unresolved"}} {
+ if {$test == ""} {set test "$cmd should execute successfully"}
+ upvar $stdout results
+ set status [catch {eval exec $cmd} results]
+ if {$status == 0} {
+ set result true
+ } else {
+ set result false
+ # Command not found (POSIX/ENOENT = no such file or directory)?
+ if {[lindex $::errorCode 0] == "POSIX" && [lindex $::errorCode 1] == "ENOENT"} {
+ # Yes, command not found;
+ # Indicate test is unsupported
+ unsupported "$test"
+ } else {
+ $failcmd "$test"
+ }; # if
+ }; # if
+ return $result
+}; # assert_exec()
+
+
+# Check that no completion is attempted on a certain command.
+# Params:
+# @cmd The command to attempt to complete.
+# @test Optional parameter with test name.
+proc assert_no_complete {{cmd} {test ""}} {
+ if {[string length $test] == 0} {
+ set test "$cmd shouldn't complete"
+ }; # if
+
+ send "$cmd\t"
+ expect -ex "$cmd"
+
+ # We can't anchor on $, simulate typing a magical string instead.
+ set endguard "Magic End Guard"
+ send "$endguard"
+ expect {
+ -re "^$endguard$" { pass "$test" }
+ default { fail "$test" }
+ timeout { fail "$test" }
+ }; # expect
+}; # assert_no_complete()
+
+
+# Check that no output is generated on a certain command.
+# @param string $cmd The command to attempt to complete.
+# @param string $test Optional parameter with test name.
+# @param string $prompt (optional) Bash prompt. Default is "/@"
+proc assert_no_output {{cmd} {test ""} {prompt /@}} {
+ if {[string length $test] == 0} {
+ set test "$cmd shouldn't generate output"
+ }
+
+ send "$cmd\r"
+ expect -ex "$cmd"
+
+ expect {
+ -re "^\r\n$prompt$" { pass "$test" }
+ default { fail "$test" }
+ timeout { fail "$test" }
+ }
+}
+
+
+# Source/run file with additional tests if completion for the specified command
+# is installed in bash.
+# @param string $command Command to check completion availability for.
+# @param string $file (optional) File to source/run. Default is
+# "lib/completions/$cmd.exp".
+proc assert_source_completions {command {file ""}} {
+ if {[is_bash_completion_installed_for $command]} {
+ if {[string length $file] == 0} {
+ set file "lib/completions/$command.exp"
+ }
+ source $file
+ } else {
+ untested $command
+ }
+}
+
+
+# Sort list.
+# `exec sort' is used instead of `lsort' to achieve exactly the
+# same sort order as in bash.
+# @param list $items
+# @return list Sort list
+proc bash_sort {items} {
+ return [split [exec sort << [join $items "\n"]] "\n"]
+}
+
+
+# Get 'known' hostnames. Looks also in ssh's 'known_hosts' files.
+# @param string cword (optional) Word, hosts should start with.
+# @return list Hostnames
+# @see get_hosts()
+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"]
+ # 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
+# @return list Hostnames
+proc get_hosts_avahi {} {
+ # Retrieving hosts is successful?
+ if { [catch {exec bash -c {
+ type avahi-browse >&/dev/null \
+ && avahi-browse -cpr _workstation._tcp 2>/dev/null | command grep ^= | cut -d\; -f7 | sort -u
+ }} hosts] } {
+ # No, retrieving hosts yields error;
+ # Reset hosts
+ set hosts {}
+ }; # if
+ return $hosts
+}; # get_hosts_avahi()
+
+
+# Get signals
+# This function is written in analogy to the bash function `_signals()' in
+# `bash_completion'.
+# @return list Signals starting with `SIG', but with the `SIG' prefix removed.
+proc get_signals {} {
+ set signals {}
+ foreach signal [exec bash -c {compgen -A signal}] {
+ # Does signal start with `SIG'?
+ if {[string range $signal 0 [expr [string length "SIG"] - 1]] == "SIG"} {
+ # Remove `SIG' prefix
+ 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
+ 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()
+
+
+# Check whether completion is installed for the specified command by executing
+# `complete -p ...' in bash.
+# @param string $command Command to check completion availability for.
+# @return boolean True (1) if completion is installed, False (0) if not.
+proc is_bash_completion_installed_for {command} {
+ set test "$command should have completion installed in bash"
+ set cmd "complete -p $command &> /dev/null && echo -n 0 || echo -n 1"
+ send "$cmd\r"
+ expect "$cmd\r\n"
+ expect {
+ -ex 0 { set result true }
+ -ex 1 { set result false }
+ }
+ 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.
+# Break items into chunks because `expect' seems to have a limited buffer size
+# @param list $items
+# @param integer $size Chunk size
+# @result boolean True if successful, False if not
+proc match_items {items test {prompt /@} {size 20}} {
+ 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
+ if {$i > $size} { set expected "\\s*" } else { set expected "" }
+ for {set j 0} {$j < $size && $i + $j < [llength $items]} {incr j} {
+ 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} {
+ 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 "^$prompt$" {set result false; break }
+ "\r\n" { set result false; break }
+ default { set result false; break }
+ timeout { set result false; break }
+ }; # expect
+ } else {
+ expect {
+ -re "^$expected" { set result true }
+ default { set result false; break }
+ timeout { set result false; break }
+ }; # expect
+ }; # if
+ }; # for
+ return $result
+}; # match_items()
+
+
+
+# Get real command.
+# - arg: $1 Command
+# - return: Command found, empty string if not found
+proc realcommand {cmd} {
+ set result ""
+ if [string length [set path [auto_execok $cmd]]] {
+ if {[string length [auto_execok realpath]]} {
+ set result [exec realpath $path]
+ } elseif {[string length [auto_execok readlink]]} {
+ set result [exec readlink -f $path]
+ } else {
+ set result $path
+ }; # if
+ }; # if
+ return $result
+}; # realcommand()
+
+
+# Generate filename to save environment to.
+# @param string $file File-basename to save environment to. If the file has a
+# `.exp' suffix, it is removed. E.g.:
+# - "file.exp" becomes "file.env1~"
+# - "" becomes "env.env1~"
+# - "filename" becomes "filename.env1~"
+# The file will be stored in the $TESTDIR/tmp directory.
+# @param integer $seq Sequence number. Must be either 1 or 2.
+proc gen_env_filename {{file ""} {seq 1}} {
+ if {[string length $file] == 0} {
+ set file "env"
+ } else {
+ # Remove possible directories
+ set file [file tail $file]
+ # 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
+# @param string $file Filename to generate environment save file from. See
+# `gen_env_filename()'.
+proc save_env {{file ""}} {
+ _save_env [gen_env_filename $file 1]
+}; # save_env()
+
+
+# Save the environment for later comparison
+# @param string File to save the environment to. Default is "$TESTDIR/tmp/env1~".
+# @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_COMPAT_DIR=$BASH_COMPLETION_DIR}
+ assert_bash_exec {BASH_COMPLETION=$(cd "$TESTDIR/.."; pwd)/bash_completion}
+ assert_bash_exec {source "$BASH_COMPLETION"}
+}; # source_bash_completion()
+
+
+# Split line into words, disregarding backslash escapes (e.g. \b (backspace),
+# \g (bell)), but taking backslashed spaces into account.
+# Aimed for simulating bash word splitting.
+# Example usage:
+#
+# % set a {f cd\ \be}
+# % split_words $a
+# f {cd\ \be}
+#
+# @param string Line to split
+# @return list Words
+proc split_words_bash {line} {
+ set words {}
+ set glue false
+ foreach part [split $line] {
+ set glue_next false
+ # Does `part' end with a backslash (\)?
+ if {[string last "\\" $part] == [string length $part] - [string length "\\"]} {
+ # Remove end backslash
+ 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;
+ set zz [lindex $words [expr [llength $words] - 1]]
+ # Separate glue with backslash-space (\ );
+ lset words [expr [llength $words] - 1] "$zz\\ $part"
+ } else {
+ # 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
+# completing from $part $full will be the only option.
+#
+# Arguments:
+# list The list of full completions.
+# partName Output parameter for the partial string.
+# fullName Output parameter for the full string, member of item.
+#
+# Results:
+# 1, or 0 if no suitable result was found.
+proc find_unique_completion_pair {{list} {partName} {fullName}} {
+ upvar $partName part
+ upvar $fullName full
+ set bestscore 0
+ set list [lsort $list]
+ set n [llength $list]
+ for {set i 0} {$i < $n} {incr i} {
+ set cur [lindex $list $i]
+ set curlen [string length $cur]
+
+ set prev [lindex $list [expr {$i - 1}]]
+ set next [lindex $list [expr {$i + 1}]]
+ set diffprev [expr {$prev == ""}]
+ set diffnext [expr {$next == ""}]
+
+ # Analyse each item of the list and look for the minimum length of the
+ # partial prefix which is distinct from both $next and $prev. The list
+ # is sorted so the prefix will be unique in the entire list.
+ #
+ # In the worst case we analyse every character in the list 3 times.
+ # That's actually very fast, sorting could take more.
+ for {set j 0} {$j < $curlen} {incr j} {
+ set curchar [string index $cur $j]
+ if {!$diffprev && [string index $prev $j] != $curchar} {
+ set diffprev 1
+ }
+ if {!$diffnext && [string index $next $j] != $curchar} {
+ set diffnext 1
+ }
+ if {$diffnext && $diffprev} {
+ break
+ }
+ }
+
+ # At the end of the loop $j is the index of last character of
+ # the unique partial prefix. The length is one plus that.
+ set parlen [expr {$j + 1}]
+ if {$parlen >= $curlen} {
+ continue
+ }
+
+ # Try to find the most "readable pair"; look for a long pair where
+ # $part is about half of $full.
+ if {$parlen < $curlen / 2} {
+ set parlen [expr {$curlen / 2}]
+ }
+ set score [expr {$curlen - $parlen}]
+ if {$score > $bestscore} {
+ set bestscore $score
+ set part [string range $cur 0 [expr {$parlen - 1}]]
+ set full $cur
+ }
+ }
+ return [expr {$bestscore != 0}]
+}
+
+
+# Start bash running as test environment.
+proc start_bash {} {
+ global TESTDIR TOOL_EXECUTABLE spawn_id
+ set TESTDIR [pwd]
+ # 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"
+ # 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.
+#
+# 'set -x' can be very useful for debugging but by default it writes to
+# stderr. Bash 4.1 has a feature to redirect this output to a random FD.
+#
+# This function uses file descriptor 6. This will break if any completion
+# tries to use the same descriptor.
+proc init_bash_xtrace {{fname xtrace.log}} {
+ global BASH_VERSINFO
+ if {([lindex $BASH_VERSINFO 0] == 4 && [lindex $BASH_VERSINFO 1] < 1) ||
+ [lindex $BASH_VERSINFO 0] < 4} {
+ note "BASH_XTRACEFD not available in this version; no xtrace.log"
+ return
+ }
+ verbose "Enabling bash xtrace output to '$fname'"
+ assert_bash_exec "exec 6>'$fname'"
+ assert_bash_exec "BASH_XTRACEFD=6"
+ assert_bash_exec "set -o xtrace"
+}
+
+
+# Setup test environment
+#
+# Common initialization for unit and completion tests.
+proc start_interactive_test {} {
+ start_bash
+ source_bash_completion
+ init_tcl_bash_globals
+
+ global OPT_BASH_XTRACE
+ if {[info exists OPT_BASH_XTRACE]} {
+ init_bash_xtrace
+ }
+ global OPT_TIMEOUT
+ if {[info exists OPT_TIMEOUT]} {
+ global timeout
+ verbose "Changing default expect timeout from $timeout to $OPT_TIMEOUT"
+ set timeout $OPT_TIMEOUT
+ }
+}
+
+
+# Interrupt completion and sync with prompt.
+# Send signals QUIT & INT.
+# @param string $prompt (optional) Bash prompt. Default is "/@"
+proc sync_after_int {{prompt /@}} {
+ set test "Sync after INT"
+ sleep .1
+ send \031\003; # QUIT/INT
+ # Wait to allow bash to become ready
+ # See also: http://lists.alioth.debian.org/pipermail/bash-completion-devel/
+ # 2010-February/002566.html
+ sleep .1
+ # NOTE: Regexp `.*' causes `expect' to discard previous unknown output.
+ # This is necessary if a completion doesn't match expectations.
+ # For instance with `filetype_xspec' completion (e.g. `kdvi') if
+ # one expects `.txt' as a completion (wrong, because it isn't
+ # there), the unmatched completions need to be cleaned up.
+ expect -re ".*$prompt$"
+}
+
+
+proc sync_after_tab {} {
+ # NOTE: Wait in case completion returns nothing - because `units' isn't
+ # 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
+# @return string Working directory. E.g. /, or /fixtures/
+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/library.sh b/test/lib/library.sh
new file mode 100644
index 00000000..98107dcb
--- /dev/null
+++ b/test/lib/library.sh
@@ -0,0 +1,75 @@
+# Bash library for bash-completion DejaGnu testsuite
+
+
+# @param $1 Char to add to $COMP_WORDBREAKS
+# @see remove_comp_wordbreak_char()
+add_comp_wordbreak_char() {
+ if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
+ [[ "${COMP_WORDBREAKS//[^$1]}" ]] || COMP_WORDBREAKS=$COMP_WORDBREAKS$1
+ fi
+} # add_comp_wordbreak_char()
+
+
+# Diff environment files to detect if environment is unmodified
+# @param $1 File 1
+# @param $2 File 2
+# @param $3 Additional sed script
+diff_env() {
+ diff "$1" "$2" | sed -e "
+# Remove diff line indicators
+ /^[0-9,]\{1,\}[acd]/d
+# Remove diff block separators
+ /---/d
+# Remove underscore variable
+ /[<>] _=/d
+# Remove PPID bash variable
+ /[<>] PPID=/d
+ $3"
+} # diff_env()
+
+
+# Output array elements, sorted and separated by newline
+# Unset variable after outputting.
+# @param $1 Name of array variable to process
+echo_array() {
+ local name=$1[@]
+ printf "%s\n" "${!name}" | sort
+} # echo_array()
+
+
+# Check if current bash version meets specified minimum
+# @param $1 (integer) Major version number
+# @param $2 (integer) Minor version number
+# @param $3 (integer) Patch level
+# @return 0 if success, > 0 if not
+is_bash_version_minimal() {
+ [[ (
+ ${BASH_VERSINFO[0]} -gt $1
+ ) || (
+ ${BASH_VERSINFO[0]} -eq $1 &&
+ ${BASH_VERSINFO[1]} -gt $2
+ ) || (
+ ${BASH_VERSINFO[0]} -eq $1 &&
+ ${BASH_VERSINFO[1]} -eq $2 &&
+ ${BASH_VERSINFO[2]} -ge $3
+ )
+ ]]
+} # is_bash_version_minimal()
+
+
+# @param $1 Char to remove from $COMP_WORDBREAKS
+# @see add_comp_wordbreak_char()
+remove_comp_wordbreak_char() {
+ if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
+ COMP_WORDBREAKS=${COMP_WORDBREAKS//$1}
+ fi
+} # remove_comp_wordbreak_char()
+
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/lib/unit.exp b/test/lib/unit.exp
new file mode 100644
index 00000000..de870332
--- /dev/null
+++ b/test/lib/unit.exp
@@ -0,0 +1,17 @@
+source lib/library.exp
+
+
+proc unit_exit {} {
+ # Exit bash
+ send "\rexit\r"
+}
+
+
+proc unit_start {} {
+ start_interactive_test
+}
+
+
+proc unit_version {} {
+ puts "$::TESTDIR, bash-$::BASH_VERSION"
+}
diff --git a/test/unit/__expand_tilde_by_ref.exp b/test/unit/__expand_tilde_by_ref.exp
new file mode 100644
index 00000000..d4a75d11
--- /dev/null
+++ b/test/unit/__expand_tilde_by_ref.exp
@@ -0,0 +1,87 @@
+# @param string $out Reference to variable to hold value of bash environment
+# variable $HOME.
+proc setup {home user} {
+ upvar $home _home
+ upvar $user _user
+ save_env
+ assert_bash_exec {echo "$HOME"} {} /@ _home
+ 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
+
+
+set test "function should run without errors"
+assert_bash_exec {__expand_tilde_by_ref > /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="~"; __expand_tilde_by_ref aa; }; foo; unset foo} $test
+
+
+sync_after_int
+
+
+set test "~user should return /home/user"
+set cmd [format {var="~%s"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user]
+assert_bash_list "$home" $cmd $test
+
+
+sync_after_int
+
+
+set test "~/foo should return /home/user/foo"
+set cmd {var='~/foo'; __expand_tilde_by_ref var; printf "%s" "$var"}
+assert_bash_list "$home/foo" $cmd $test
+
+
+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]
+assert_bash_list "$home/bar" $cmd $test
+
+
+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]
+assert_bash_list "$home/\$HOME" $cmd $test
+
+
+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]
+assert_bash_list [list [format {%s/a b} $home]] $cmd $test
+
+
+sync_after_int
+
+
+set test "~user/* should return /home/user/*"
+set cmd [format {var="~%s/*"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user]
+assert_bash_list "$home/\*" $cmd $test
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/unit/_count_args.exp b/test/unit/_count_args.exp
new file mode 100644
index 00000000..da61bdb6
--- /dev/null
+++ b/test/unit/_count_args.exp
@@ -0,0 +1,68 @@
+proc setup {} {
+ assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_bash_exec {unset args COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
+ # Delete 'COMP_WORDBREAKS' occupying two lines
+ assert_env_unmodified {
+ /COMP_WORDBREAKS=/{N
+ d
+ }
+ }
+}; # teardown()
+
+
+setup
+
+
+set test "_count_args should run without errors"
+assert_bash_exec {_count_args > /dev/null} $test
+
+
+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}
+assert_bash_list 1 $cmd $test
+
+
+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}
+assert_bash_list 1 $cmd $test
+
+
+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}
+assert_bash_list 2 $cmd $test
+
+
+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}
+assert_bash_list 1 $cmd $test
+
+
+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}
+assert_bash_list 2 $cmd $test
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp
new file mode 100644
index 00000000..204d31cf
--- /dev/null
+++ b/test/unit/_filedir.exp
@@ -0,0 +1,267 @@
+proc setup {} {
+ assert_bash_exec {unset COMPREPLY cur}
+ assert_bash_exec {unset -f _f}
+ save_env
+ # Declare bash completion function `_f'
+ assert_bash_exec { \
+ _f() { local cur=$(_get_cword); unset COMPREPLY; _filedir; }; \
+ complete -F _f f \
+ }
+ # Declare bash completion function `_f2' with `-o filenames' active.
+ assert_bash_exec { \
+ complete -F _f -o filenames f2 \
+ }
+ # Declare bash completion function `_g' to complete on `.e1' files
+ assert_bash_exec { \
+ _g() { local cur=$(_get_cword); unset COMPREPLY; _filedir e1; }; \
+ complete -F _g g \
+ }
+ # Create directories `a*b' and `a\b' only when not running on Cygwin/Windows;
+ # 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)}
+ # Create directory `a\b'
+ assert_bash_exec {(cd fixtures/_filedir && [ ! -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 {unset COMPREPLY cur}
+ assert_bash_exec {unset -f _f _g}
+ assert_bash_exec {complete -r f g}
+ assert_env_unmodified {
+ /OLDPWD/d
+ /OLD_CTYPE/d
+ }
+}
+
+
+setup
+
+
+set test "_filedir should run without errors"
+assert_bash_exec {_filedir > /dev/null} $test
+
+
+sync_after_int
+
+
+foreach name {f f2} {
+
+ set test "completing $name ab/ should return e"
+ set cmd "$name ab/"
+ assert_complete_dir e $cmd "fixtures/_filedir" $test
+
+
+ sync_after_int
+
+
+ set test "completing $name a\\ b/ should return i"
+ set cmd "$name a\\ b/"
+ assert_complete_dir i $cmd "fixtures/_filedir" $test
+
+
+ sync_after_int
+
+
+ set test "completing $name a\\\'b/ should return c"
+ set cmd "$name a\\\'b/"
+ assert_complete_dir c $cmd "fixtures/_filedir" $test
+
+
+ sync_after_int
+
+
+ set test "completing $name a\\\"b/ should return d"; #"
+ set cmd "$name a\\\"b/"; #"
+ assert_complete_dir d $cmd "fixtures/_filedir" $test
+
+
+ sync_after_int
+
+
+ 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
+
+
+ sync_after_int
+
+
+ # Execute these tests only when not running on Cygwin/Windows, because
+ # directories containing asterisk (*) or backslash (\) aren't allowed on
+ # Cygwin/Windows
+ 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
+
+
+ sync_after_int
+ }
+
+
+ set test "completing $name a\\&b/ should return f"
+ set cmd "$name a\\&b/"
+ assert_complete_dir f $cmd "fixtures/_filedir" $test
+
+
+ sync_after_int
+
+
+ set test "completing $name a\$ should return a\\\$b/"
+ set cmd "$name a\$"
+ assert_complete_dir "\b\\\\\$b/" $cmd "fixtures/_filedir" $test
+
+
+ sync_after_int
+
+
+ # NOTE: Bash versions 4.0.0 up to 4.0.34 contain a bug when completing quoted
+ # words, so tests below aren't executed for these bash versions.
+ if {! (
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+ )} {
+ set cmd "$name 'ab/"
+ assert_complete_dir {e'} $cmd "fixtures/_filedir"
+
+
+ sync_after_int
+
+
+ set cmd "$name 'a b/"
+ assert_complete_dir {i'} $cmd "fixtures/_filedir"
+
+
+ sync_after_int
+
+
+ set cmd "$name 'a\"b/"; #"
+ assert_complete_dir {d'} $cmd "fixtures/_filedir"
+
+
+ sync_after_int
+
+
+ set cmd "$name 'a\$b/"
+ if {[lindex $::BASH_VERSINFO 0] == 4} {
+ assert_complete_dir {h'} $cmd "fixtures/_filedir"
+ } else {
+ assert_complete_dir "\b\b\b\b$::TESTDIR/fixtures/_filedir/a\$b/h'" $cmd "fixtures/_filedir"
+ }
+
+
+ sync_after_int
+
+
+ # 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"
+
+
+ sync_after_int
+ }
+
+
+ set cmd "$name 'a&b/"
+ assert_complete_dir {f'} $cmd "fixtures/_filedir"
+
+
+ sync_after_int
+
+
+ set cmd "$name \"ab/"; #"
+ assert_complete_dir {e"} $cmd "fixtures/_filedir"; #"
+
+
+ sync_after_int
+
+
+ set cmd "$name \"a b/"; #"
+ assert_complete_dir {i"} $cmd "fixtures/_filedir"; #"
+
+
+ sync_after_int
+
+
+ set cmd "$name \"a'b/"; #"
+ assert_complete_dir {c"} $cmd "fixtures/_filedir"; #"
+
+
+ sync_after_int
+
+
+ set cmd "$name \"a\\\"b/"; #"
+ assert_complete_dir {d"} $cmd "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"
+
+
+ sync_after_int
+
+
+ set cmd "$name \"a\\b/"; #"
+ assert_complete_dir "\b\b\bb/e\\\"" $cmd "fixtures/_filedir"
+
+
+ sync_after_int
+
+
+ set cmd "$name \"a\\\\b/"; #"
+ assert_complete_dir {g"} $cmd "fixtures/_filedir"; #"
+
+
+ sync_after_int
+
+
+ set cmd "$name \"a&b/"; #"
+ assert_complete_dir {f"} $cmd "fixtures/_filedir"; #"
+
+
+ sync_after_int
+
+
+ }; # if 4.0.0 < bash-version > 4.0.34
+}; # foreach
+
+
+set test "completing with filter '.e1' should show completions"
+assert_complete_dir {ee.e1 foo/ gg.e1} "g " "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"
+} else {
+ assert_complete_dir "\b\b\b\b$'a\\\\303\\\\251/g'" "f aé/" \
+ "fixtures/_filedir"
+}
+# Restore LC_CTYPE
+assert_bash_exec {[[ $OLD_CTYPE ]] && LC_CTYPE=$OLD_CTYPE || unset LC_CTYPE}
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/unit/_get_comp_words_by_ref.exp b/test/unit/_get_comp_words_by_ref.exp
new file mode 100644
index 00000000..22561e7f
--- /dev/null
+++ b/test/unit/_get_comp_words_by_ref.exp
@@ -0,0 +1,386 @@
+proc setup {} {
+ assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_bash_exec { \
+ unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS cur prev words cword \
+ cur2 prev2 words2 cword2 \
+ }
+ # Delete 'COMP_WORDBREAKS' occupying two lines
+ assert_env_unmodified {
+ /COMP_WORDBREAKS=/{N
+ d
+ }
+ }
+}; # teardown()
+
+
+setup
+
+
+set test "_get_comp_words_by_ref should run without errors"
+assert_bash_exec {_get_comp_words_by_ref cur > /dev/null} $test
+
+
+sync_after_int
+
+
+# See also ./lib/completions/alias.exp. Here `_get_cword' is actually tested
+# by moving the cursor left into the current word.
+
+
+set test "a b|"; # | = cursor position
+set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list {"b a"} $cmd $test
+
+
+sync_after_int
+
+
+set test "a |"; # | = cursor position
+set cmd {COMP_WORDS=(a); COMP_CWORD=1; COMP_LINE='a '; COMP_POINT=2; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list {" a"} $cmd $test
+
+
+sync_after_int
+
+
+set test "a b |"; # | = cursor position
+set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list {" b"} $cmd $test
+
+
+sync_after_int
+
+
+set test "a b | with WORDBREAKS -= :"; # | = cursor position
+set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_comp_words_by_ref -n : cur; printf %s "$cur"}
+assert_bash_list {} $cmd $test
+
+
+sync_after_int
+
+
+set test "a b|c"; # | = cursor position
+set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list {"b a"} $cmd $test
+
+
+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_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list {"b\\ c a"} $cmd $test
+
+
+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_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list {"b\\ a"} $cmd $test
+
+
+sync_after_int
+
+
+set test {a "b\|}; #"# | = cursor position
+set cmd {COMP_WORDS=(a '"b\'); COMP_CWORD=1; COMP_LINE='a "b\'; COMP_POINT=5; _get_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list {"\"b\\ a"} $cmd $test
+
+
+sync_after_int
+
+
+set test {a 'b c|}; # | = cursor position
+if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+} {
+ 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"
+expect {
+ -ex "'b c a\r\n/@" { pass "$test" }
+ -ex "c b\r\n/@" {
+ if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+ } {xfail "$test"} {fail "$test"}
+ }
+}; # expect
+
+
+sync_after_int
+
+
+set test {a "b c|}; #"# | = cursor position
+if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+} {
+ 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"};
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -ex "\"b c a\r\n/@" { pass "$test" }
+ -ex "c b\r\n/@" {
+ if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+ } {xfail "$test"} {fail "$test"}
+ }
+}; # expect
+
+
+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=1}
+ set expected {"b:c a"}
+} 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
+set cmd {_get_comp_words_by_ref cur prev; echo "$cur $prev"}
+assert_bash_list $expected $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=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"}
+assert_bash_list {"b:c a"} $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=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"}
+assert_bash_list {"c: b"} $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
+set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"}
+assert_bash_list {": a"} $cmd $test
+
+
+sync_after_int
+
+
+set test {a b::| with WORDBREAKS -= : should return b::}; # | = cursor position
+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"}
+assert_bash_list {"b:: a"} $cmd $test
+
+
+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}
+assert_bash_exec $cmd
+set cmd {_get_comp_words_by_ref cur; printf %s $cur}
+assert_bash_list -n $cmd $test
+
+
+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}
+assert_bash_exec $cmd
+set cmd {_get_comp_words_by_ref cur prev; echo "$cur"}
+assert_bash_list c $cmd $test
+
+
+sync_after_int
+
+
+set test {a b=c| should return b=c (bash-3) or c (bash-4)}; # | = cursor position
+if {[lindex $::BASH_VERSINFO] <= 3} {
+ set cmd {COMP_WORDS=(a "b=c"); COMP_CWORD=1}
+ set expected b=c
+} 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"}
+assert_bash_list $expected $cmd $test
+
+
+sync_after_int
+
+
+set test {a *| should return *}; # | = cursor position
+set cmd {COMP_WORDS=(a \*); COMP_CWORD=1; COMP_LINE='a *'; COMP_POINT=4}
+assert_bash_exec $cmd
+set cmd {_get_comp_words_by_ref cur; echo "$cur"}
+assert_bash_list * $cmd $test
+
+
+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=7}
+assert_bash_exec $cmd
+set cmd {_get_comp_words_by_ref cur; printf %s "$cur"}
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -ex "\$(b c/@" { pass "$test" }
+ # Expected failure on bash-4
+ -ex "c/@" { xfail "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test {a $(b c\ d| should return $(b c\ d}; # | = cursor position
+set cmd {COMP_WORDS=(a '$(b c\ d'); COMP_CWORD=1; COMP_LINE='a $(b c\ d'; COMP_POINT=10}
+assert_bash_exec $cmd
+set cmd {_get_comp_words_by_ref cur; printf %s "$cur"}
+#assert_bash_list {{$(b\ c\\\ d}} $cmd $test
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -ex "\$(b c\\ d/@" { pass "$test" }
+ # Expected failure on bash-4
+ -ex "c\\ d/@" { xfail "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test {a 'b&c| should return 'b&c}; # | = cursor position
+if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+} {
+ 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"}
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -ex "'b&c/@" { pass "$test" }
+ -ex "c/@" {
+ if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+ } {xfail "$test"} {fail "$test"}
+ }
+}; # expect
+
+
+sync_after_int
+
+
+set test {unknown argument should raise error}
+set cmd {_get_comp_words_by_ref dummy}
+assert_bash_list {"bash: _get_comp_words_by_ref(): `dummy': unknown argument"} $cmd $test
+
+
+sync_after_int
+
+
+set test "a b| to all vars"; # | = cursor position
+set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3}
+assert_bash_exec $cmd
+set cmd { \
+ _get_comp_words_by_ref words cword prev cur; echo "${words[@]} $cword $cur $prev" \
+}
+assert_bash_list {"a b 1 b a"} $cmd $test
+
+
+sync_after_int
+
+
+set test "a b| to alternate vars"; # | = cursor position
+set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3;}
+assert_bash_exec $cmd
+set cmd {_get_comp_words_by_ref -c cur2 -p prev2 -w words2 -i cword2}
+assert_bash_exec $cmd
+set cmd {echo "$cur2 $prev2 ${words2[@]} $cword2"}
+assert_bash_list {"b a a b 1"} $cmd $test
+
+
+sync_after_int
+
+
+set test "a b| to alternate vars"; # | = cursor position
+set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3;}
+assert_bash_exec $cmd
+set cmd {_get_comp_words_by_ref -c cur2 -p prev2 -w words2 -i cword2}
+assert_bash_exec $cmd
+set cmd {echo "$cur2 $prev2 ${words2[@]} $cword2"}
+assert_bash_list {"b a a b 1"} $cmd $test
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/unit/_get_cword.exp b/test/unit/_get_cword.exp
new file mode 100644
index 00000000..1e6e9bfb
--- /dev/null
+++ b/test/unit/_get_cword.exp
@@ -0,0 +1,316 @@
+proc setup {} {
+ assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS}
+ # Delete 'COMP_WORDBREAKS' occupying two lines
+ assert_env_unmodified {
+ /COMP_WORDBREAKS=/{N
+ d
+ }
+ }
+}; # teardown()
+
+
+setup
+
+
+set test "_get_cword should run without errors"
+assert_bash_exec {_get_cword > /dev/null} $test
+
+
+sync_after_int
+
+
+# See also ./lib/completions/alias.exp. Here `_get_cword' is actually tested
+# by moving the cursor left into the current word.
+
+
+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}
+assert_bash_list b $cmd $test
+
+
+sync_after_int
+
+
+set test "a | should return nothing"; # | = cursor position
+set cmd {COMP_WORDS=(a); COMP_CWORD=1; COMP_LINE='a '; COMP_POINT=2; _get_cword}
+send "$cmd\r"
+expect -ex "$cmd\r\n/@" {pass "$test"}
+
+
+sync_after_int
+
+
+set test "a b | should return nothing"; # | = cursor position
+set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_cword}
+send "$cmd\r"
+expect -ex "$cmd\r\n/@" {pass "$test"}
+
+
+sync_after_int
+
+
+set test "a b | with WORDBREAKS -= : should return nothing"; # | = cursor position
+set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_cword :}
+send "$cmd\r"
+expect -ex "$cmd\r\n/@" {pass "$test"}
+
+
+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}
+assert_bash_list b $cmd $test
+
+
+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}
+assert_bash_list {"b\\ c"} $cmd $test
+
+
+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}
+assert_bash_list {"b\\"} $cmd $test
+
+
+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}
+assert_bash_list {"\"b\\"} $cmd $test
+
+
+sync_after_int
+
+
+set test {a 'b c| should return 'b c}; # | = cursor position
+if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+} {
+ 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"
+expect {
+ -ex "'b c/@" { pass "$test" }
+ -ex "c/@" {
+ if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+ } {xfail "$test"} {fail "$test"}
+ }
+}; # expect
+
+
+sync_after_int
+
+
+set test {a "b c| should return "b c}; # | = cursor position
+if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+} {
+ 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"
+expect {
+ -ex "\"b c/@" { pass "$test" }
+ -ex "c/@" {
+ if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+ } {xfail "$test"} {fail "$test"}
+ }
+}; # expect
+
+
+sync_after_int
+
+
+set test {a b:c| with WORDBREAKS += : should return b:c (bash-3) or c (bash-4)}; # | = cursor position
+if {[lindex $::BASH_VERSINFO 0] <= 3} {
+ set cmd {COMP_WORDS=(a "b:c"); COMP_CWORD=1}
+ set expected b:c
+} 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}
+assert_bash_list $expected $cmd $test
+
+
+sync_after_int
+
+
+set test {a b:c| with WORDBREAKS -= : should return b:c}; # | = cursor position
+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 :}
+assert_bash_list b:c $cmd $test
+
+
+sync_after_int
+
+
+set test {a b c:| with WORDBREAKS -= : should return c:}; # | = 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=3}
+}; # if
+append cmd {; COMP_LINE='a b c:'; COMP_POINT=6; _get_cword :}
+assert_bash_list 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; _get_cword :}
+assert_bash_list : $cmd $test
+
+
+sync_after_int
+
+
+set test {a b::| with WORDBREAKS -= : should return b::}; # | = cursor position
+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 :}
+assert_bash_list b:: $cmd $test
+
+
+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}
+assert_bash_list -n $cmd $test
+
+
+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}
+assert_bash_list c $cmd $test
+
+
+sync_after_int
+
+
+set test {a b=c| should return b=c (bash-3) or c (bash-4)}; # | = cursor position
+if {[lindex $::BASH_VERSINFO] <= 3} {
+ set cmd {COMP_WORDS=(a "b=c"); COMP_CWORD=1}
+ set expected b=c
+} 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}
+assert_bash_list $expected $cmd $test
+
+
+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}
+assert_bash_list * $cmd $test
+
+
+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=7; _get_cword}
+#assert_bash_list {{$(b\ c}} $cmd $test
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -ex "\$(b c/@" { pass "$test" }
+ # Expected failure on bash-4
+ -ex "c/@" { xfail "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test {a $(b c\ d| should return $(b c\ d}; # | = cursor position
+set cmd {COMP_WORDS=(a '$(b c\ d'); COMP_CWORD=1; COMP_LINE='a $(b c\ d'; COMP_POINT=10; _get_cword}
+#assert_bash_list {{$(b\ c\\\ d}} $cmd $test
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -ex "\$(b c\\ d/@" { pass "$test" }
+ # Expected failure on bash-4
+ -ex "c\\ d/@" { xfail "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test {a 'b&c| should return 'b&c}; # | = cursor position
+if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+} {
+ 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"
+expect {
+ -ex "'b&c/@" { pass "$test" }
+ -ex "c/@" {
+ if {
+ [lindex $::BASH_VERSINFO 0] == 4 &&
+ [lindex $::BASH_VERSINFO 1] == 0 &&
+ [lindex $::BASH_VERSINFO 2] < 35
+ } {xfail "$test"} {fail "$test"}
+ }
+}; # expect
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp
new file mode 100644
index 00000000..152cf885
--- /dev/null
+++ b/test/unit/_known_hosts_real.exp
@@ -0,0 +1,118 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {
+ /COMPREPLY=/d
+ /OLDHOME=/d
+ }
+}; # teardown()
+
+
+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
+set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY}
+assert_bash_list $hosts $cmd $test
+
+
+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
+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
+
+
+sync_after_int
+
+
+set test "Files containing consecutive spaces should work"
+set hosts [get_hosts]
+set hosts_orig $hosts
+ # Hosts `gee' and `hus' are defined in `./fixtures/_known_hosts_real/spaced conf'
+ # Host `two' is defined in ./fixtures/_known_hosts_real/known_hosts2
+lappend hosts gee hus two
+set hosts_config $hosts
+ # Hosts `doo' and `ike' are defined in `./fixtures/_known_hosts_/spaced known_hosts'
+lappend hosts doo ike
+set hosts [join [bash_sort $hosts ] "\\s+"]
+set hosts_orig [join [bash_sort $hosts_orig ] "\\s+"]
+set hosts_config [join [bash_sort $hosts_config] "\\s+"]
+ # Call _known_hosts
+set cmd {unset COMPREPLY; _known_hosts_real -aF 'fixtures/_known_hosts_real/spaced conf' ''; echo_array COMPREPLY}
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -re "^$hosts\r\n/@$" { pass "$test" }
+ -re "^$hosts_orig\r\n/@$" { fail "$test (config file)" }
+ -re "^$hosts_config\r\n/@$" { fail "$test (known hosts file)" }
+ -re /@ { unresolved "$test at prompt" }
+ default { unresolved "$test" }
+}; # expect
+
+
+sync_after_int
+
+
+set test "Files starting with tilde (~) should work"
+set hosts [get_hosts]
+ # Host `two' is defined in ./fixtures/_known_hosts_real/known_hosts2
+ # Host `three' is defined in ./fixtures/_known_hosts_real/known_hosts3
+lappend hosts two three
+set hosts [join [bash_sort $hosts] "\\s+"]
+ # Setup environment
+set cmd {OLDHOME=$HOME; HOME=$TESTDIR}
+send "$cmd\r"
+expect -ex "$cmd\r\n/@"
+ # Call _known_hosts
+set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config_tilde ''; echo_array COMPREPLY}
+send "$cmd\r"
+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"
+expect -ex "$cmd\r\n/@"
+
+
+sync_after_int
+
+
+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
+ # 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
+sync_after_int
+assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE"
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/unit/compgen.exp b/test/unit/compgen.exp
new file mode 100644
index 00000000..6673bf0e
--- /dev/null
+++ b/test/unit/compgen.exp
@@ -0,0 +1,52 @@
+proc setup {} {
+ save_env
+}; # setup()
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD/d}
+}; # teardown()
+
+
+setup
+
+
+if {[lindex $::BASH_VERSINFO 0] <= 3} {
+ set test {compgen -f a\\\\\\\'b/ on bash-3 should return a\'b/c};
+ set cmd {compgen -f a\\\\\\\'b/}
+} else {
+ set test {compgen -f a\\\'b/ on bash-4 should return a\'b/c};
+ set cmd {compgen -f a\\\'b/}
+}; # if
+set dir fixtures/compgen
+set prompt "/$dir/@"
+assert_bash_exec "cd $dir" "" $prompt
+send "$cmd\r"
+expect -ex "$cmd\r\n"
+expect {
+ -re {a\\\'b/c} {
+ # On bash-3.2, compgen returns inconsequent output
+ if {
+ [lindex $::BASH_VERSINFO 0] >= 4 || (
+ [lindex $::BASH_VERSINFO 0] == 3 &&
+ [lindex $::BASH_VERSINFO 1] == 2
+ )
+ } {pass $test} else {fail $test}
+ }
+ -re {a'b/c} {
+ if {[lindex $::BASH_VERSINFO 0] <= 3 } \
+ {pass $test} else {fail $test}
+ }
+ -re $prompt { pass "$test" }
+ -re eof { unresolved "eof" }
+}; # expect
+sync_after_int $prompt
+assert_bash_exec {cd "$TESTDIR"}
+
+#assert_bash_list_dir {a\\\'b/c} $cmd fixtures/compgen
+
+
+sync_after_int
+
+
+teardown
diff --git a/test/unit/find_unique_completion_pair.exp b/test/unit/find_unique_completion_pair.exp
new file mode 100644
index 00000000..ec7f040d
--- /dev/null
+++ b/test/unit/find_unique_completion_pair.exp
@@ -0,0 +1,37 @@
+# Note: This test actually tests a function in the test library. It doesn't
+# need bash running; but it doesn't hurt either.
+
+# Run one test. Look below for usage.
+proc test_find_ucp {{list} {epart} {econt} {eret 1}} {
+ set efull "$epart$econt"
+ set rret [find_unique_completion_pair $list rpart rfull]
+ if {$eret != $rret} {
+ if {$eret} {
+ fail "find_unique_completion_pair: Nothing found for {$list}"
+ } else {
+ fail "find_unique_completion_pair: Expected failure for {$list}"
+ }
+ } elseif {!$eret} {
+ pass "find_unique_completion_pair: No results for list {$list}"
+ } elseif {$rpart != $epart || $rfull != $efull} {
+ fail "find_unique_completion_pair: Got \"$rpart\", \"$rfull\" \
+ instead of \"$epart\", \"$efull\" for list {$list}"
+ } else {
+ pass "find_unique_completion_pair: Got \"$epart\", \"$efull\" \
+ for list {$list}"
+ }
+}
+
+test_find_ucp {a} 0 0 0
+test_find_ucp {ab} a b
+test_find_ucp {a ab abcd abc} 0 0 0
+test_find_ucp {a ab abcde abc} abcd e
+test_find_ucp {user1 user2} 0 0 0
+test_find_ucp {root username2 username1} ro ot
+test_find_ucp {root username21 username2} ro ot
+test_find_ucp {long_user_name lang_user_name long_usor_name} lang_us er_name
+test_find_ucp {lang_user_name1 long_user_name lang_user_name long_usor_name} \
+ long_use r_name
+test_find_ucp {root username} user name
+test_find_ucp {a aladin} ala din
+test_find_ucp {ala aladin} alad in