File: Spec.hs

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

import Test.Hspec
import Test.Hspec.SmallCheck

main :: IO ()
main = hspec spec

spec :: Spec
spec = do
  describe "reverse" $ do
    it "reverses a list" $ do
      reverse [1 :: Int, 2, 3] `shouldBe` [3, 2, 1]

    it "gives the original list, if applied twice" $ property $
      \xs -> (reverse . reverse) xs `shouldBe` (xs :: [Int])