692938a4e26ec6faeeb8713d4fe63e8fded309a0
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
]]
43 # 2 arguments, test that link is made correctly
64 PATH
="$(readlink -f ${0%/*}/..):$PATH"
66 # might want to undo this if things go wrong
69 # trap errors, and output a simple bash stack trace
71 trap 'echo "${BASH_COMMAND:+BASH_COMMAND=\"$BASH_COMMAND\" }
72 ${FUNCNAME:+FUNCNAME=\"$FUNCNAME\" }${LINENO:+LINENO=\"$LINENO\" }\$?=$?"' ERR
76 # test again, using rm -rf in place of trash-put.
77 trash-put
() { rm -rf -- "$@"; }