소스 검색

Test big chunks

John Carr 16 년 전
부모
커밋
445073e6e1
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      dulwich/tests/test_pack.py

+ 6 - 0
dulwich/tests/test_pack.py

@@ -99,6 +99,9 @@ class TestPackDeltas(unittest.TestCase):
   test_string2 = "The answer was falling down the pipe"
   test_string3 = "zzzzz"
 
+  test_string_empty = ""
+  test_string_big = "Z" * 8192
+
   def _test_roundtrip(self, base, target):
     self.assertEquals(target,
       apply_delta(base, create_delta(base, target)))
@@ -112,6 +115,9 @@ class TestPackDeltas(unittest.TestCase):
   def test_rewrite(self):
     self._test_roundtrip(self.test_string1, self.test_string3)
 
+  def test_overflow(self):
+    self._test_roundtrip(self.test_string_empty, self.test_string_big)
+
 
 class TestPackData(PackTests):
   """Tests getting the data from the packfile."""