Exemple #1
0
 def test_one_range(self):
     self.assertEqual(find_ranges([1, 2, 3, 4, 5, 6, 7]), ["1->7"])
Exemple #2
0
 def test_five_lists_of_two(self):
     self.assertEqual(find_ranges([2, 3, 5, 6, 8, 9, 11, 12, 14, 15]),
                      ["2->3", "5->6", "8->9", "11->12", "14->15"])
Exemple #3
0
 def test_empty_list(self):
     self.assertEqual(find_ranges([]), [])
Exemple #4
0
 def test_two_ranges_one_small(self):
     self.assertEqual(find_ranges([1, 2, 3, 4, 5, 8, 9]), ["1->5", "8->9"])
Exemple #5
0
 def test_no_range(self):
     self.assertEqual(find_ranges([1]), [])
Exemple #6
0
 def test_two_ranges(self):
     self.assertEqual(find_ranges([1, 2, 3, 4, 5, 8, 9, 10]),
                      ["1->5", "8->10"])