2019-10-11 00:20:26 +03:00
|
|
|
module JamTests (tests) where
|
|
|
|
|
2020-01-23 07:16:09 +03:00
|
|
|
import Ur.Arvo.Event
|
2020-01-23 05:58:22 +03:00
|
|
|
import Ur.Noun.Conversions
|
|
|
|
import Ur.Noun.Cue
|
|
|
|
import Ur.Noun.Jam
|
2020-01-23 07:16:09 +03:00
|
|
|
import Ur.Prelude
|
2019-10-11 00:20:26 +03:00
|
|
|
|
|
|
|
import GHC.Natural (Natural(..))
|
|
|
|
import Test.QuickCheck hiding ((.&.))
|
|
|
|
import Test.QuickCheck.Gen
|
|
|
|
import Test.QuickCheck.Random
|
|
|
|
import Test.Tasty
|
|
|
|
import Test.Tasty.QuickCheck
|
|
|
|
import Test.Tasty.TH
|
|
|
|
|
|
|
|
instance Arbitrary Natural where
|
|
|
|
arbitrary = arbitrarySizedNatural
|
|
|
|
|
|
|
|
prop_cueJamAtom :: Atom -> Bool
|
|
|
|
prop_cueJamAtom a = Right (Atom a) == cue (jam (Atom a))
|
|
|
|
|
|
|
|
prop_cueJamNoun :: Noun -> Bool
|
|
|
|
prop_cueJamNoun n = Right n == cue (jam n)
|
|
|
|
|
|
|
|
tests :: TestTree
|
|
|
|
tests = $(testGroupGenerator)
|
|
|
|
|