示例#1
0
 def test_array_length2(self):
     self.assertEqual(longest_run([1, 2]), 3, 'Simple array [1, 2]')
示例#2
0
 def test_array_example_5(self):
     self.assertEqual(longest_run([2, 2, 2, 2, 3, 4, 5]), 14, 'Repeated elements larger than three')
示例#3
0
 def test_array_example_7(self):
     self.assertEqual(longest_run([2, 2, 3, 4, 5, 2, 2, 2]), 14, 'Repeated elements equal length of monotonic list')
示例#4
0
 def test_array_example_3(self):
     self.assertEqual(longest_run([1, 2, 3, 4, 5, 6, 7, 8, 9]), 45, 'Pure monotonically increasing list')
示例#5
0
 def test_array_example_3(self):
     self.assertEqual(longest_run([9, 8, 7, 6, 5, 4, 3, 2, 1]), 45, 'Pure monotonically decreasing list')
示例#6
0
 def test_array_example_2(self):
     self.assertEqual(longest_run([1, 2, 3, 2, -1]), 6, 'List of equal length but different content')
示例#7
0
 def test_array_example_1(self):
     self.assertEqual(longest_run([1, 2, 3, 2, 1]), 6, 'Lists of equal length and content')
示例#8
0
 def test_array_with_repeated_elements(self):
     self.assertEqual(longest_run([1, 2, 5, 4, 4, 3, 2]), 8, 'Array containing repeated elements')
示例#9
0
 def test_array_decreasing(self):
     self.assertEqual(longest_run([1, 2, 5, 4, 3, 1]), 13, 'Monotonically decreasing list')
示例#10
0
 def test_array_increasing(self):
     self.assertEqual(longest_run([1, 2, 1, 3, 4, 5]), 13, 'Monotonically increasing list')