コード例 #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')