Commit 1491d322 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Add test for refinement of exponentials

parent bced57f5
......@@ -241,7 +241,18 @@ refineSpec = describe "refining" $ do
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc)
(Part.numBlocks part) `shouldBe` 4
it "correctly distinguishes different exponential values" $ do
-- {a,b} + X^2
let f = mkPoly [[Const (v ["A", "B"])], [Exponential Variable (v ["i", "j"])]]
let res = morphp f
"a: inj 0 (A)\n\
\b: inj 0 (B)\n\
\x: inj 1 {i: a, j: b}\n\
\y: inj 1 {i: b, j: a}"
res `shouldSatisfy` isRight
let Right enc = res
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc)
(Part.numBlocks part) `shouldBe` 4
-- Helpers
mkPoly :: [[Factor a]] -> Polynomial a
......
Supports Markdown
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