summaryrefslogtreecommitdiff
path: root/testit
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-04-25 05:54:03 +1200
committerLars Wirzenius <liw@liw.fi>2010-04-25 05:54:03 +1200
commit1448638a75aac754e71356094166739eac48b5c2 (patch)
tree2b28b2b6683486bf7fe4e2f9ab9f095faa9f61d4 /testit
parent6ea588287a64a03fa43ba05881db99a4854f6d10 (diff)
downloaddupfiles-1448638a75aac754e71356094166739eac48b5c2.tar.gz
Add test for two hardlinks.
Diffstat (limited to 'testit')
-rwxr-xr-xtestit13
1 files changed, 13 insertions, 0 deletions
diff --git a/testit b/testit
index 83e3a98..f38d34a 100755
--- a/testit
+++ b/testit
@@ -40,6 +40,10 @@ class TestCase(object):
def create(self, name, content):
file(os.path.join(self.tempdir, name), 'w').write(content)
+
+ def hardlink(self, name, newname):
+ os.link(os.path.join(self.tempdir, name),
+ os.path.join(self.tempdir, newname))
def test(self):
p = subprocess.Popen(['./dupfiles', self.tempdir],
@@ -79,10 +83,19 @@ class TwoIdenticalFiles(TestCase):
self.identical = ['foo', 'bar']
+class TwoHardlinksToSameContent(TestCase):
+
+ def setUp(self):
+ self.create('foo', 'foo')
+ self.hardlink('foo', 'bar')
+ self.identical = []
+
+
def main():
klasses = [
DifferentFiles,
TwoIdenticalFiles,
+ TwoHardlinksToSameContent,
]
for klass in klasses:
test = klass()