Commit 3a01062a authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢

Add test for parsing Z^X

parent 54b3d357
......@@ -23,6 +23,7 @@ import Control.Monad (when)
import Data.Complex
import Control.DeepSeq (NFData)
import Data.Ratio
import Data.Functor.Classes
import Data.Vector (Vector)
import qualified Data.Vector as V
......@@ -42,6 +43,9 @@ import Copar.FunctorDescription
data GroupValued m a = GroupValued a
instance Eq1 (GroupValued m) where
liftEq f (GroupValued a1) (GroupValued a2) = f a1 a2
deriving instance Show (GroupValued m ())
deriving instance Functor (GroupValued m)
deriving instance Foldable (GroupValued m)
......
......@@ -7,6 +7,8 @@ import TestHelpers
import Data.Complex
import Data.Ratio
import Copar.FunctorExpression.Parser
import Copar.FunctorDescription
import Copar.Functors.GroupValued
import Copar.Coalgebra.Parser
import Copar.FunctorExpression.Type
......@@ -16,11 +18,17 @@ import Data.Float.Utils ( EqDouble )
spec :: Spec
spec = do
paseIntSpec
parseMorphismPointIntSpec
parseMorphismPointDoubleSpec
parseMorphismPointComplexSpec
parseMorphismPointRationalSpec
paseIntSpec :: Spec
paseIntSpec = describe "Int-valued parser" $ do
it "parses Z^X" $
parseFunctorExpression [[functorExprParser intValued]] "" "Z^X"
`shouldParse` (Functor 1 (GroupValued Variable))
parseMorphismPointIntSpec :: Spec
parseMorphismPointIntSpec = describe "parseMorphismPoint (Int)" $ do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment