def test_empty(self): self.assertEqual( sut.commonprefix([]), '')
def test_no_common_prefix(self): self.assertEqual( sut.commonprefix(['/tmp/abs/a.c', '/usr/ack/b.c']), '/')
def test_with_single_file(self): self.assertEqual( sut.commonprefix(['/tmp/a.c']), '/tmp')
def test_with_single_file_on_windows(self): self.assertEqual(sut.commonprefix(['z:\\tmp\\a.c']), 'z:\\tmp')
def test_with_different_dirnames(self): self.assertEqual( sut.commonprefix(['/tmp/abs/a.c', '/tmp/ack/b.c']), '/tmp')
def test_no_common_prefix_on_windows(self): self.assertEqual( sut.commonprefix(['z:\\tmp\\abs\\a.c', 'z:\\usr\\ack\\b.c']), 'z:\\')
def test_different_drive_on_windows(self): self.assertEqual( sut.commonprefix(['c:\\tmp\\abs\\a.c', 'z:\\usr\\ack\\b.c']), '')
def test_with_different_dirnames_on_windows(self): self.assertEqual( sut.commonprefix(['c:\\tmp\\abs\\a.c', 'c:\\tmp\\ack\\b.c']), 'c:\\tmp')
def test_with_single_file_on_windows(self): self.assertEqual( sut.commonprefix(['z:\\tmp\\a.c']), 'z:\\tmp')