示例#1
0
 def testCommonPrefixLen_WithSomeCommonPrefixes(self):
     """
     Test the common prefixes of a few strings where only some of them
     match.
     """
     instrings = ["Hello World", "Hell on Earth", "Good Bye World", "Sayonara World"]
     self.assertEqual(0, dtpp.find_common_prefix_len(instrings))
示例#2
0
 def testCommonPrefixLen_WithEmptyFewStrings(self):
     """
     Test the common prefixes of a few strings where some of them are
     empty.
     """
     instrings = ["Hello World", "", "", "Hello World"]
     self.assertEqual(0, dtpp.find_common_prefix_len(instrings))
示例#3
0
 def testCommonPrefixLen_AllNonEmpty(self):
     """
     Test the common prefixes of a few non-empty strings.
     """
     instrings = ["Hello World", "Hell on earth", "Helium Balloons"]
     self.assertEqual(3, dtpp.find_common_prefix_len(instrings))
示例#4
0
 def testCommonPrefixLen_AllNonEmptyWithoutCommonPrefixes(self):
     """
     Test the common prefixes of a few non-empty strings without any common prefixes
     """
     instrings = ["Hello World", "Good Bye World", "Sayonara World"]
     self.assertEqual(0, dtpp.find_common_prefix_len(instrings))