[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:49:58 UTC 2010


The following commit has been merged in the master branch:
commit 7595db6902df9c7c2f32b0d0a1973d03ef3457e5
Author: John Goerzen <jgoerzen at complete.org>
Date:   Sat Dec 4 10:56:47 2004 +0100

    Applied Inflate fix from Ian
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.7--patch-37)

diff --git a/ChangeLog b/ChangeLog
index 922955c..536e36c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,19 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
 #
 
+2004-12-04 03:56:47 GMT	John Goerzen <jgoerzen at complete.org>	patch-37
+
+    Summary:
+      Applied Inflate fix from Ian
+    Revision:
+      missingh--head--0.7--patch-37
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/Compression/Inflate.hs
+     testsrc/GZiptest.hs
+
+
 2004-12-04 02:42:45 GMT	John Goerzen <jgoerzen at complete.org>	patch-36
 
     Summary:
diff --git a/libsrc/MissingH/Compression/Inflate.hs b/libsrc/MissingH/Compression/Inflate.hs
index bfffc9b..c1a40d6 100644
--- a/libsrc/MissingH/Compression/Inflate.hs
+++ b/libsrc/MissingH/Compression/Inflate.hs
@@ -285,8 +285,8 @@ inflate_codes seen_last tabs@(tab_litlen, tab_dist)
                           return (pref ++ o)
 
 litlens :: [(Code, (LitLen, Word32))]
-litlens = zip [257..285] $ mk_bases 3 litlen_counts
-    where litlen_counts = [(8,0),(4,1),(4,2),(4,3),(4,4),(4,5),(1,0)]
+litlens = zip [257..285] $ mk_bases 3 litlen_counts ++ [(258, 0)]
+    where litlen_counts = [(8,0),(4,1),(4,2),(4,3),(4,4),(4,5)]
 
 dist_code :: Table -> InfM Dist
 dist_code tab
diff --git a/testsrc/GZiptest.hs b/testsrc/GZiptest.hs
index bfd9cf6..770c81b 100644
--- a/testsrc/GZiptest.hs
+++ b/testsrc/GZiptest.hs
@@ -22,19 +22,29 @@ import MissingH.FileArchive.GZip
 import MissingH.Compression.Inflate
 import System.IO
 import MissingH.Either
+import Data.List
 
 mf fn exp conf = TestLabel fn $ TestCase $
                      do c <- readFile ("testsrc/gzfiles/" ++ fn)
                         assertEqual "" exp (conf c)
 
+test_bunches =
+    let f fn exp conv = mf fn exp (conv . snd . forceEither . read_header)
+        f2 c = let fn = "t/z" ++ (show c) ++ ".gz" in
+                   f fn c (length . inflate_string)
+        in
+        map f2 [0..1000]
+
 test_inflate = 
     let f fn exp conv = mf fn exp (conv . snd . forceEither . read_header) in
         [
          f "t1.gz" "Test 1" inflate_string
+        ,f "t1.gz" 6 (length . inflate_string)
         ,f "t1.gz" ("Test 1",
                     "\x19\xf8\x27\x99\x06\x00\x00\x00") inflate_string_remainder
         ,f "empty.gz" "" inflate_string
-        ,f "zeros.gz" (replicate (10 * 1048576) '\0') inflate_string
+        ,f "zeros.gz" 10485760 (length . inflate_string)
+        --,f "zeros.gz" (replicate (10 * 1048576) '\0') inflate_string
         ]
 
 test_header =
@@ -59,6 +69,7 @@ test_gunzip =
 
 tests = TestList [TestLabel "inflate" (TestList test_inflate),
                   TestLabel "header" (TestList test_header),
+                  TestLabel "bunches" (TestList test_bunches),
                   TestLabel "gunzip" (TestList test_gunzip)
 
                  ]

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list