@@ -96,13 +96,6 @@ tests =
9696 ]
9797 ]
9898
99−{-
100− -- these tests use the R structure
101− --
102− -- quickCheck prop_Word32_from_2_Word16
103− -- quickCheck prop_Word32_from_Word8_and_Word16
104−-}
105−
10699prop_putget_with_bitreq :: (BinaryBit a, Num a, Bits a, Ord a) => W a -> Property
107100prop_putget_with_bitreq (W w) = property $
108101 -- write all words with as many bits as it's required
@@ -167,7 +160,7 @@ prop_bitget_bytestring_interspersed (W ws) bss = property $
167160 r = runGet (runBitGet g) lbs
168161 in map (ws,) bss == r
169162
170−-- number of bits required to write @v@
163+-- | number of bits required to write @v@
171164bitreq :: (Num b, Bits a, Ord a) => a -> b
172165bitreq v = fromIntegral . head $ [ req | (req, top) <- bittable, v <= top ]
173166
@@ -194,7 +187,6 @@ prop_composite_case b (W w) = w < 0x8000 ==>
194187 w' = runGet (runBitGet g) lbs
195188 in w == w'
196189
197−
198190prop_compare_put_with_naive :: (Bits a, BinaryBit a, Ord a) => W [a] -> Property
199191prop_compare_put_with_naive (W ws) = property $
200192 let pn = mapM_ (\v -> naive_put (bitreq v) v) ws
@@ -230,27 +222,6 @@ naive_get n0 =
230222 True -> loop (n-1) ((acc `shiftL` 1) + 1)
231223 in loop n0 0
232224
233−{-
234−prop_Word32_from_Word8_and_Word16 :: Word8 -> Word16 -> Property
235−prop_Word32_from_Word8_and_Word16 w8 w16 = property $
236− let p = RWord32be 24
237− w' = runGet (get p) lbs
238− in w0 == w'
239− where
240− lbs = runPut (putWord8 w8 >> putWord16be w16)
241− w0 = ((fromIntegral w8) `shiftL` 16) .|. fromIntegral w16
242−
243−prop_Word32_from_2_Word16 :: Word16 -> Word16 -> Property
244−prop_Word32_from_2_Word16 w1 w2 = property $
245− let p = RWord32be 32
246− w' = runGet (get p) lbs
247− in w0 == w'
248− where
249− lbs = encode w0
250− w0 = ((fromIntegral w1) `shiftL` 16) .|. fromIntegral w2
251−-}
252−
253−
254225shrinker :: (Num a, Ord a, Bits a) => a -> [a]
255226shrinker 0 = []
256227shrinker w = [ w `shiftR` 1 -- try to make everything roughly half size