Пример #1
0
 def test_nothing_in_common(self):
     string1 = 'nothing in'
     string2 = 'common'
     response = longest_common_prefix(string1, string2)
     expected = 0
     self.assertEquals(response, expected)
Пример #2
0
 def test_longest_common_prefix_different_sizes(self):
     string1 = 'cada'
     string2 = 'cadabra$'
     response = longest_common_prefix(string1, string2)
     expected = 4
     self.assertEquals(response, expected)
Пример #3
0
 def test_longest_common_prefix_python_phrases_inverted(self):
     string1 = 'python is cool'
     string2 = 'python rocks'
     response = longest_common_prefix(string1, string2)
     expected = 7
     self.assertEquals(response, expected)
Пример #4
0
 def test_longest_common_prefix_empty_string(self):
     string1 = ''
     string2 = 'other string is empty :/'
     response = longest_common_prefix(string1, string2)
     expected = 0
     self.assertEquals(response, expected)