[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:44 UTC 2010
The following commit has been merged in the master branch:
commit 9a551e6ba2d9cb59a67d15ec7ea3f81a8e9f4827
Author: John Goerzen <jgoerzen at complete.org>
Date: Sat Dec 4 07:11:36 2004 +0100
Checkpointing more tests
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.7--patch-26)
diff --git a/ChangeLog b/ChangeLog
index c342121..052744b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,23 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
#
+2004-12-04 00:11:36 GMT John Goerzen <jgoerzen at complete.org> patch-26
+
+ Summary:
+ Checkpointing more tests
+ Revision:
+ missingh--head--0.7--patch-26
+
+
+ new files:
+ debian/libghc6-missingh-dev.postinst.debhelper
+ debian/libghc6-missingh-dev.prerm.debhelper
+
+ modified files:
+ ChangeLog libsrc/MissingH/FileArchive/GZip.hs
+ testsrc/GZiptest.hs
+
+
2004-12-03 23:07:55 GMT John Goerzen <jgoerzen at complete.org> patch-25
Summary:
diff --git a/debian/libghc6-missingh-dev.postinst.debhelper b/debian/libghc6-missingh-dev.postinst.debhelper
new file mode 100644
index 0000000..6ab4b6a
--- /dev/null
+++ b/debian/libghc6-missingh-dev.postinst.debhelper
@@ -0,0 +1,26 @@
+# Automatically added by dh_haskell
+GHC=ghc-6.2.2
+CONFIGFILE=/usr/lib/haskell-packages/ghc6/lib/MissingH-0.6.0/installed-pkg-config
+
+
+case "$1" in
+ configure)
+ /usr/lib/$GHC/bin/ghc-pkg -g --add-package \
+ < $CONFIGFILE
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+
+
+# arch-tag: haskell-devscripts generic GHC postinst template
+# End automatically added section
diff --git a/debian/libghc6-missingh-dev.prerm.debhelper b/debian/libghc6-missingh-dev.prerm.debhelper
new file mode 100644
index 0000000..7e31de7
--- /dev/null
+++ b/debian/libghc6-missingh-dev.prerm.debhelper
@@ -0,0 +1,25 @@
+# Automatically added by dh_haskell
+
+GHC=ghc-6.2.2
+CONFIGFILE=/usr/lib/haskell-packages/ghc6/lib/MissingH-0.6.0/installed-pkg-config
+CABALNAME=MissingH
+
+
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ /usr/lib/$GHC/bin/ghc-pkg -r $CABALNAME
+ rm -vf /usr/lib/haskell-packages/ghc6/lib/MissingH-0.6.0/HSMissingH-0.6.0.o
+
+ ;;
+ failed-upgrade)
+ ;;
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+
+# arch-tag: haskell-devscripts generic GHC prerm template
+# End automatically added section
diff --git a/libsrc/MissingH/FileArchive/GZip.hs b/libsrc/MissingH/FileArchive/GZip.hs
index 894c9e1..eddf0d8 100644
--- a/libsrc/MissingH/FileArchive/GZip.hs
+++ b/libsrc/MissingH/FileArchive/GZip.hs
@@ -19,7 +19,8 @@ The GZip format is described in RFC1952
-}
module MissingH.FileArchive.GZip (
- decompress
+ decompress,
+ read_header
)
where
@@ -65,9 +66,11 @@ decompress s =
let rem = snd x
return $ inflate_string rem
-}
+
decompress s = do x <- read_sections s
return $ concatMap snd x
+
-- | Read all sections. Returns (Header, ThisSection)
read_sections :: String -> Either GZipError [(Header, String)]
read_sections [] = Right []
diff --git a/testsrc/GZiptest.hs b/testsrc/GZiptest.hs
index a8c3d2c..da8053b 100644
--- a/testsrc/GZiptest.hs
+++ b/testsrc/GZiptest.hs
@@ -19,20 +19,32 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
module GZiptest(tests) where
import HUnit
import MissingH.FileArchive.GZip
+import MissingH.Compression.Inflate
import System.IO
+import MissingH.Either
+
+mf fn exp conf = TestLabel fn $ TestCase $
+ do c <- readFile ("testsrc/gzfiles/" ++ fn)
+ assertEqual "" exp (conf c)
+
+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" ("Test 1",
+ "\x19\xf8\x27\x99\x06\x00\x00\x00") inflate_string_remainder
+ ]
+
test_gunzip =
- let f fn exp = TestLabel fn $ TestCase $
- do
- fd <- openFile ("testsrc/gzfiles/" ++ fn) ReadMode
- c <- hGetContents fd
- assertEqual "" (Right exp) (decompress c)
+ let f fn exp = mf fn (Right exp) decompress
in
[
f "t1.gz" "Test 1"
]
-tests = TestList [TestLabel "gunzip" (TestList test_gunzip)
+tests = TestList [TestLabel "inflate" (TestList test_inflate),
+ TestLabel "gunzip" (TestList test_gunzip)
]
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list