This commit is contained in:
Stefan Dresselhaus
2022-03-14 20:12:24 +01:00
commit befb1ab1eb
23 changed files with 1973 additions and 0 deletions

1
test/Spec.hs Normal file
View File

@ -0,0 +1 @@
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}

14
test/UtilSpec.hs Normal file
View File

@ -0,0 +1,14 @@
{-# LANGUAGE NoImplicitPrelude #-}
module UtilSpec (spec) where
import Import
import Util
import Test.Hspec
import Test.Hspec.QuickCheck
spec :: Spec
spec = do
describe "plus2" $ do
it "basic check" $ plus2 0 `shouldBe` 2
it "overflow" $ plus2 maxBound `shouldBe` minBound + 1
prop "minus 2" $ \i -> plus2 i - 2 `shouldBe` i