Commit 92efd0a8 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢

Fix tests

parent b090cb5a
......@@ -80,7 +80,7 @@ enc f1s transitions = Encoding.new (V.fromList f1s) edges
initialize' :: [Bool] -> [(State, State)] -> ST s ([Block], AlgoState s Powerset)
initialize' f1s transitions =
initialize @Powerset (enc f1s (map mkEdge transitions))
initialize @Powerset (enc f1s (map mkEdge transitions)) True
where
mkEdge (from, to) = (from, (), to)
......
......@@ -281,7 +281,7 @@ withState
-> (forall s . SplitM s f a)
-> a
withState e action = runST $ do
(q, as) <- initialize e
(q, as) <- initialize e True
queue <- Queue.empty 20
mapM_ (Queue.enqueue queue) q
runSplit as queue action
......
......@@ -228,13 +228,13 @@ refineSpec = describe "refining" $ do
it "distinguishes constants" $ do
let Right enc =
morphp (mkPoly [[c ["a", "b"]]]) "x: inj 0 (a)\ny: inj 0 (b)"
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc True)
(Part.toBlocks part) `shouldMatchList` [[0], [1]]
it "distinguishes co-factors" $ do
let f = mkPoly [[c ["a"]], [c ["a"]]]
let Right enc = morphp f "x: inj 0 (a)\ny: inj 1 (a)"
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc True)
(Part.toBlocks part) `shouldMatchList` [[0], [1]]
it "correctly identifies factors" $ do
......@@ -249,7 +249,7 @@ refineSpec = describe "refining" $ do
\y: inj 1 (b, a)"
res `shouldSatisfy` isRight
let Right enc = res
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc True)
(Part.numBlocks part) `shouldBe` 4
it "correctly distinguishes different exponential values" $ do
......@@ -264,7 +264,7 @@ refineSpec = describe "refining" $ do
\y: inj 1 {i: b, j: a}"
res `shouldSatisfy` isRight
let Right enc = res
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted AbsorbingPolynomial)) enc True)
(Part.numBlocks part) `shouldBe` 4
......
......@@ -53,7 +53,7 @@ refineSpec = describe "refining" $ do
it "distinguishes points with different successor count"
$ let Right (_, enc) =
parseMorphisms f EnableSanityChecks "" "x: {x, x, y}\ny: {x, y}"
in stToIO (refine (Proxy @(Desorted Bag)) enc)
in stToIO (refine (Proxy @(Desorted Bag)) enc True)
`shouldReturn` (Part.fromBlocks [[0], [1]])
-- FIXME: Remove duplicate definition of this function
......
......@@ -84,7 +84,7 @@ refineSpec = describe "refining" $ do
let x = parseMorphisms f EnableSanityChecks "" "x: {z: 1.0}\ny: {z: 1.0}\nz: {y: 1.0}"
x `shouldSatisfy` isRight
let Right (_, enc) = x
stToIO (refine (Proxy @(Desorted Distribution)) enc) `shouldReturn` Part.fromBlocks [[0, 1, 2]]
stToIO (refine (Proxy @(Desorted Distribution)) enc True) `shouldReturn` Part.fromBlocks [[0, 1, 2]]
-- FIXME: Remove duplicate definition of this function
encoding :: [f1] -> [(Int, l, Int)] -> Encoding l f1
......
......@@ -94,12 +94,12 @@ maxIntRefineSpec = describe "maxInt refine" $ do
it "it distinguishes different maximas with equal sums" $ do
let Right enc = p "x: {x: 1, y: 3}\ny: {x: 2, y: 2}"
part <- stToIO (refine proxy enc)
part <- stToIO (refine proxy enc True)
(Part.toBlocks part) `shouldMatchList` [[0], [1]]
it "identifies equal maximas with different sums" $ do
let Right enc = p "x: {x: 1, y: 3}\ny: {x: 3, y: 2}"
part <- stToIO (refine proxy enc)
part <- stToIO (refine proxy enc True)
(Part.toBlocks part) `shouldMatchList` [[0, 1]]
......@@ -154,12 +154,12 @@ maxRealRefineSpec = describe "maxReal refine" $ do
it "it distinguishes different maximas with equal sums" $ do
let Right enc = p "x: {x: 1.1, y: 3.1}\ny: {x: 2.1, y: 2.1}"
part <- stToIO (refine proxy enc)
part <- stToIO (refine proxy enc True)
(Part.toBlocks part) `shouldMatchList` [[0], [1]]
it "identifies equal maximas with different sums" $ do
let Right enc = p "x: {x: 1.1, y: 3.1}\ny: {x: 3.1, y: 2.1}"
part <- stToIO (refine proxy enc)
part <- stToIO (refine proxy enc True)
(Part.toBlocks part) `shouldMatchList` [[0, 1]]
......
......@@ -341,13 +341,13 @@ refineSpec = describe "refining" $ do
it "distinguishes constants" $ do
let Right enc = morphp (mkPoly [[c ["a", "b"]]]) "x: inj 0 (a)\ny: inj 0 (b)"
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc True)
(Part.toBlocks part) `shouldMatchList` [[0], [1]]
it "distinguishes co-factors" $ do
let f = mkPoly [[c ["a"]], [c ["a"]]]
let Right enc = morphp f "x: inj 0 (a)\ny: inj 1 (a)"
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc True)
(Part.toBlocks part) `shouldMatchList` [[0], [1]]
it "correctly identifies factors" $ do
......@@ -360,7 +360,7 @@ refineSpec = describe "refining" $ do
\y: inj 1 (b, a)"
res `shouldSatisfy` isRight
let Right enc = res
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc True)
(Part.numBlocks part) `shouldBe` 4
it "correctly distinguishes different exponential values" $ do
......@@ -373,7 +373,7 @@ refineSpec = describe "refining" $ do
\y: inj 1 {i: b, j: a}"
res `shouldSatisfy` isRight
let Right enc = res
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc)
part <- stToIO (refine (Proxy @(Desorted Polynomial)) enc True)
(Part.numBlocks part) `shouldBe` 4
-- Helpers
......
......@@ -43,5 +43,5 @@ process file =
>>= \case
Left err -> return err
Right (f, (symTab, enc)) -> do
partition <- stToIO (refine f enc)
partition <- stToIO (refine f enc True)
return $ T.unpack (showPartition enc symTab partition)
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