File: Tests.hs

package info (click to toggle)
haskell-conduit-zstd 0.0.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64 kB
  • sloc: haskell: 46; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{- Copyright 2018 Luis Pedro Coelho
 - License: MIT
 -}
{-# LANGUAGE TemplateHaskell, QuasiQuotes, FlexibleContexts, OverloadedStrings #-}
module Main where

import Test.Tasty
import Test.Tasty.QuickCheck
import Test.QuickCheck.Instances ()

import qualified Data.ByteString as B
import Conduit
import Data.Conduit.List (sourceList)

import Data.Conduit.Zstd

tests :: TestTree
tests =
  testProperty "roundtrip" $ \input -> ioProperty $ do
    output' <- runConduit (sourceList input .| compress 1 .| decompress .| sinkList)
    pure $ B.concat input === B.concat output'

main :: IO ()
main = defaultMain tests