File: Tests.hs

package info (click to toggle)
haskell-zenc 0.1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 84 kB
  • sloc: haskell: 143; makefile: 6
file content (17 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Main where

import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Test.Hspec
import Test.Hspec.Hedgehog

import Text.Encoding.Z

main :: IO ()
main = hspec $ do
  describe "Round trip" $ do
    it "self-inverse of arbitrary ascii" $ hedgehog $ do
      xs <- forAll $ Gen.string (Range.linear 0 100) Gen.ascii
      zDecodeString (zEncodeString xs) === xs