def test_completely_different(self): self.assertEqual(_expand('abc', 'def', 0), (None, None))
def test_startswith(self): self.assertEqual(_expand('abc', 'abcd', 0), (0, 3)) self.assertEqual(_expand('abc', 'abcd', 1), (0, 3)) self.assertEqual(_expand('abc', 'abcd', 2), (0, 3))
def test_last_item_missing(self): self.assertEqual(_expand('abcd', 'abc', 0), (None, None)) self.assertEqual(_expand('abcd', 'abc', 1), (1, 3)) self.assertEqual(_expand('abcd', 'abc', 2), (1, 3))
def test_identical(self): self.assertEqual(_expand('abc', 'abc', 0), (0, 3)) self.assertEqual(_expand('abc', 'abc', 1), (0, 3)) self.assertEqual(_expand('abc', 'abc', 2), (0, 3))
def test_empty_sequence(self): self.assertEqual(_expand('PATTERN', '', 0), (None, None))
def test_empty_subsequence(self): self.assertEqual(_expand('', 'TEXT', 0), (0, 0))
def test_both_empty(self): self.assertEqual(_expand('', '', 0), (0, 0))