示例#1
0
 def test_other_label_is_prefix(self):
     assert util.common_prefix(b"abc", b"ab") == b"ab"
示例#2
0
 def test_handles_different_lengths(self):
     assert util.common_prefix(b"abde", b"abc") == b"ab"
     assert util.common_prefix(b"ab", b"ab") == b"ab"
     assert util.common_prefix(b"ab", b"abc") == b"ab"
     assert util.common_prefix(b"abde", b"abcde") == b"ab"
示例#3
0
 def test_first_char_differs_empty(self):
     assert util.common_prefix(b"ab", b"bb") == bytes()
示例#4
0
 def test_has_common_prefix_prefix(self):
     assert util.common_prefix(b"abd", b"abc") == b"ab"
示例#5
0
 def test_falsy_argument_empty(self, label, other_label):
     assert util.common_prefix(label, other_label) == bytes()