Commit 418362a2 authored by Simon Marlow's avatar Simon Marlow
Browse files

add test for bug #661

parent a9e8bed8
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
test('hash001', normal, compile_and_run, [''])
import Data.HashTable
import qualified Data.HashTable as HT
test :: Int -> IO ()
test n = do ht <- new (==) hashInt
sequence_ [ insert ht key 0 | key <- [0..n]]
sequence_ [ insert ht key 1 | key <- [0..n]]
let check key = do (Just val) <- HT.lookup ht key
if val==1 then return () else putStrLn $ show key
sequence_ [ check key | key <- [0..n]]
main = test 2048
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