ibhelper/test/UtilSpec.hs

15 lines
341 B
Haskell
Raw Normal View History

2022-03-14 19:12:24 +00:00
{-# 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