on master help sign in
Fix isEmpty tests
bec131cAlexander Polakov
BitsQC.hs+7−6
@@ -129,17 +129,18 @@ prop_isEmptyOfEmptyEmpty = runGet (runBitGet isEmpty) L.empty
129
129
130prop_isEmptyOfNonEmptyEmpty :: L.ByteString -> Property
130prop_isEmptyOfNonEmptyEmpty :: L.ByteString -> Property
131prop_isEmptyOfNonEmptyEmpty bs =
131prop_isEmptyOfNonEmptyEmpty bs =
132− not (L.null bs) ==> runGet (runBitGet isEmpty) bs == False
132+ not (L.null bs) ==> not (runGet (runBitGet isEmpty) bs)
133
133
134−prop_isEmptyOfConsumedEmpty :: L.ByteString -> Int -> Property
134+prop_isEmptyOfConsumedEmpty :: L.ByteString -> Property
135−prop_isEmptyOfConsumedEmpty bs n =
135+prop_isEmptyOfConsumedEmpty bs =
136− (fromIntegral n) == L.length bs && not (L.null bs) ==>
136+ not (L.null bs) ==>
137− runGet (runBitGet (getByteString n >> isEmpty)) bs == True
137+ runGet (runBitGet (getByteString n >> isEmpty)) bs
138+ where n = fromIntegral $ L.length bs
138
139
139prop_isEmptyOfNotConsumedNotEmpty :: L.ByteString -> Int -> Property
140prop_isEmptyOfNotConsumedNotEmpty :: L.ByteString -> Int -> Property
140prop_isEmptyOfNotConsumedNotEmpty bs n =
141prop_isEmptyOfNotConsumedNotEmpty bs n =
141 (fromIntegral n) < L.length bs && not (L.null bs) ==>
142 (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)
143
144
144prop_getLazyByteString_equal_to_ByteString :: L.ByteString -> Int -> Property
145prop_getLazyByteString_equal_to_ByteString :: L.ByteString -> Int -> Property
145prop_getLazyByteString_equal_to_ByteString bs n =
146prop_getLazyByteString_equal_to_ByteString bs n =