~sircmpwn/ctools

ref: 0e9f63c42367ef836a3dbe9369cb987558b0d9e3 ctools/test/unlink -rwxr-xr-x 294 bytes
0e9f63c4 — Christopher Vittal Add dirname 1 year, 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
. "$HARNESS" unlink

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