~sircmpwn/ctools

ref: cc69324393fda9bcbc73d30d1bda022263f012a8 ctools/test/unlink -rwxr-xr-x 301 bytes
cc693243 — Gabor Koszegi Correct tee SIGINT test 1 year, 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
tool="unlink"
. "$HARNESS"

should_remove_link() {
	touch "$TMPDIR"/file
	link "$TMPDIR"/file "$TMPDIR"/hardlink
	unlink "$TMPDIR"/hardlink
	[ -e "$TMPDIR"/file ] && ! [ -e "$TMPDIR"/hardlink ] || return 1
	unlink -- "$TMPDIR"/file
	! [ -e "$TMPDIR"/file ]
}

runtests \
	should_remove_link