From 1448638a75aac754e71356094166739eac48b5c2 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 25 Apr 2010 05:54:03 +1200 Subject: Add test for two hardlinks. --- testit | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testit') 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() -- cgit v1.2.1