2 # some basic sanity / verification
4 # I don't recommend actually running this unless you have a reason to,
5 # since it creates & deletes files, and being a test, it is not as thoroughly
8 # assumes we have trash-put in path, and that lnf-function is in .. to this files location
11 # 2 arguments, test that a file in the link location is removed and replaed with a link
18 # 2 arguments, test that directory in link location is removed and replaced with a link
25 # single argument, test that an existing non-empty directory is removed and replaced by a link
33 # 4 arguments, 2 of the link locations already contain files.
34 # test that they got removed and replaced by links
40 [[ -L a
/b
&& -L a
/c
&& -L a
/d
]]
59 source ${0%/*}/..
/lnf-function
60 # might want to undo this if things go wrong
63 # trap errors, and output a simple bash stack trace
65 trap 'echo "${BASH_COMMAND:+BASH_COMMAND=\"$BASH_COMMAND\" }
66 ${FUNCNAME:+FUNCNAME=\"$FUNCNAME\" }${LINENO:+LINENO=\"$LINENO\" }\$?=$?"' ERR
69 # test again, using rm -rf in place of trash-put.
70 # assumes that rm is in /bin and trash-put is in /usr/bin
71 PATH
="${PATH//:\/usr\/bin}"
72 PATH
="${PATH//\/usr\/bin:}"