Skip to content

Commit

Permalink
Merge pull request #2798 from phadej/2794-remove-plain-prop
Browse files Browse the repository at this point in the history
Remove maybeDecompress_plain property
  • Loading branch information
23Skidoo committed Aug 27, 2015
2 parents 571bcfb + 6cb997a commit 9754ac2
Showing 1 changed file with 3 additions and 6 deletions.
Expand Up @@ -20,11 +20,12 @@ import Test.Tasty.QuickCheck

tests :: [TestTree]
tests = [ testCase "maybeDecompress" maybeDecompressUnitTest
, testProperty "decompress plain" $ forAll (listOf asciiWord8) prop_maybeDecompress_plain
-- "decompress plain" property is non-trivial to state,
-- maybeDecompress returns input bytestring only if error occurs right at the beginning of the decompression process
-- generating such input would essentially duplicate maybeDecompress implementation
, testProperty "decompress zlib" prop_maybeDecompress_zlib
, testProperty "decompress gzip" prop_maybeDecompress_gzip
]
where asciiWord8 = elements [32..126]

maybeDecompressUnitTest :: Assertion
maybeDecompressUnitTest =
Expand All @@ -43,10 +44,6 @@ maybeDecompressUnitTest =
runBrokenStream :: IO (Either SomeException ())
runBrokenStream = try . void . evaluate . BSLL.length $ maybeDecompress (BSLL.init compressedZlib <> BSLL.pack "*")

prop_maybeDecompress_plain :: [Word8] -> Property
prop_maybeDecompress_plain ws = property $ maybeDecompress original === original
where original = BSL.pack ws

prop_maybeDecompress_zlib :: [Word8] -> Property
prop_maybeDecompress_zlib ws = property $ maybeDecompress compressedZlib === original
where original = BSL.pack ws
Expand Down

0 comments on commit 9754ac2

Please sign in to comment.