def test_common_spans(self): for a, b, expected in [ ('an exact match', 'an exact match', [14]), ('some example string', 'some other string', [5, 7, 7]), ('a problem with a common set', 'a common set', [2, 7, 1, 4, 13]), ]: self.assertEqual(summarize.common_spans([a, b]), expected)