test-hardlink: do not test .hg/cache/checklink
authorJun Wu <quark@fb.com>
Mon, 15 May 2017 13:29:18 -0700
changeset 32295 b9135f191d8a
parent 32294 905a2eff08a6
child 32296 7e07d5836063
test-hardlink: do not test .hg/cache/checklink Linux and BSD have different behavior on "os.link(src, dst)" where "src" is a symlink. That causes test difference. According to POSIX [1]: If path1 names a symbolic link, it is implementation-defined whether link() follows the symbolic link, or creates a new link to the symbolic link itself. So both behaviors are correct. This patch removes the trouble maker "checklink" to make the test pass on both platforms. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html
tests/test-hardlinks.t
--- a/tests/test-hardlinks.t	Mon May 15 13:25:59 2017 -0700
+++ b/tests/test-hardlinks.t	Mon May 15 13:29:18 2017 -0700
@@ -214,13 +214,18 @@
 
   $ linkcp r3 r4
 
+'checklink' is produced by hardlinking a symlink, which is undefined whether
+the symlink should be followed or not. It does behave differently on Linux and
+BSD. Just remove it so the test pass on both platforms.
+
+  $ rm -f r4/.hg/cache/checklink
+
 r4 has hardlinks in the working dir (not just inside .hg):
 
   $ nlinksdir r4
   2 r4/.hg/00changelog.i
   2 r4/.hg/branch
   2 r4/.hg/cache/checkisexec (execbit !)
-  3 r4/.hg/cache/checklink (?)
   ? r4/.hg/cache/checklink-target (glob) (symlink !)
   2 r4/.hg/cache/checknoexec (execbit !)
   2 r4/.hg/cache/branch2-base