Example #1
0
 def test_one_range(self):
     self.assertEqual(find_ranges([1, 2, 3, 4, 5, 6, 7]), ["1->7"])
Example #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"])
Example #3
0
 def test_empty_list(self):
     self.assertEqual(find_ranges([]), [])
Example #4
0
 def test_two_ranges_one_small(self):
     self.assertEqual(find_ranges([1, 2, 3, 4, 5, 8, 9]), ["1->5", "8->9"])
Example #5
0
 def test_no_range(self):
     self.assertEqual(find_ranges([1]), [])
Example #6
0
 def test_two_ranges(self):
     self.assertEqual(find_ranges([1, 2, 3, 4, 5, 8, 9, 10]),
                      ["1->5", "8->10"])