on master help sign in
Fix isEmpty tests

- remove stupid Bool comparisons - no need for numeric parameter in prop_isEmptyOfConsumedEmpty suggested by @kolmodin

commitbec131cdb3636e935496947d59b1d1c7c23311ee authorAlexander Polakov <plhk@sdf.org> dateSun 31 Mar 2013, 16:40 (14 years ago) parent22c8278
1 file changed+7−6
BitsQC.hs+7−6
BitsQC.hs+7−6
@@ -129,17 +129,18 @@ prop_isEmptyOfEmptyEmpty = runGet (runBitGet isEmpty) L.empty
129129
130130prop_isEmptyOfNonEmptyEmpty :: L.ByteString -> Property
131131prop_isEmptyOfNonEmptyEmpty bs =
132− not (L.null bs) ==> runGet (runBitGet isEmpty) bs == False
132+ not (L.null bs) ==> not (runGet (runBitGet isEmpty) bs)
133133
134−prop_isEmptyOfConsumedEmpty :: L.ByteString -> Int -> Property
135−prop_isEmptyOfConsumedEmpty bs n =
136− (fromIntegral n) == L.length bs && not (L.null bs) ==>
137− runGet (runBitGet (getByteString n >> isEmpty)) bs == True
134+prop_isEmptyOfConsumedEmpty :: L.ByteString -> Property
135+prop_isEmptyOfConsumedEmpty bs =
136+ not (L.null bs) ==>
137+ runGet (runBitGet (getByteString n >> isEmpty)) bs
138+ where n = fromIntegral $ L.length bs
138139
139140prop_isEmptyOfNotConsumedNotEmpty :: L.ByteString -> Int -> Property
140141prop_isEmptyOfNotConsumedNotEmpty bs n =
141142 (fromIntegral n) < L.length bs && not (L.null bs) ==>
142− runGet (runBitGet (getByteString n >> isEmpty)) bs == False
143+ not (runGet (runBitGet (getByteString n >> isEmpty)) bs)
143144
144145prop_getLazyByteString_equal_to_ByteString :: L.ByteString -> Int -> Property
145146prop_getLazyByteString_equal_to_ByteString bs n =