Commit c3acdcc6 authored by Sebastian Graf's avatar Sebastian Graf

Compare output of compress2 by hashing

This should fix the build in the same way as !2.
parent e1869fd3
......@@ -36,7 +36,6 @@ real/compress/compress
real/compress/compress.stdin
real/compress2/compress2
real/compress2/compress2.stdin
real/compress2/compress2.stdout
real/eff/CS/CS
real/eff/CSD/CSD
real/eff/FS/FS
......
......@@ -8,12 +8,16 @@ where
import Encode
import WriteRoutines
import System.IO
import Data.Char
import Data.List (foldl')
hash :: String -> Int
hash = foldl' (\acc c -> ord c + acc*31) 0
main = do
hSetBinaryMode stdin True
hSetBinaryMode stdout True
i <- getContents
putStr (compress i)
print (hash (compress i))
-- The output is given by a magic header consisting of two fixed numbers,
-- and a third representing the maximum number of bits used per code and
......
TOP = ../..
include $(TOP)/mk/boilerplate.mk
SRC_RUNTEST_OPTS += -stdout-binary
SRC_HC_OPTS += -fglasgow-exts
SRC_RUNTEST_OPTS += +RTS -H100m -RTS
CLEAN_FILES += compress2.stdin
include $(TOP)/mk/target.mk
boot :: compress2.stdin compress2.faststdin compress2.stdout
boot :: compress2.stdin
CAT_FILES = compress2.faststdin *.hs compress2.faststdin *.hs
compress2.stdin : compress2.faststdin
cat $(CAT_FILES) $(CAT_FILES) $(CAT_FILES) $(CAT_FILES) $(CAT_FILES) > compress2.stdin
compress2.stdout : compress2.stdin compress2
./compress2 < compress2.stdin > compress2.stdout
clean ::
rm -f compress2.stdin compress2.stdout
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment