diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/WorldTypesTest.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/WorldTypesTest.hs b/test/WorldTypesTest.hs index 3c48c4e..f1822fc 100644 --- a/test/WorldTypesTest.hs +++ b/test/WorldTypesTest.hs @@ -8,6 +8,7 @@ import World.Types , Compatible (..) , Pos , LatticeProposal (..) + , LatticePropList (..) , AgentProposal (..) , Proposal (..) ) @@ -75,4 +76,16 @@ latticePropTests = testGroup "lattice proposal tests" $ LatticeProposal (0, 0) (Just 2) (Just 4) (Just $ MockMerge 4) @?= merge (LatticeProposal (0, 0) (Just 2) Nothing Nothing) (LatticeProposal (0, 0) Nothing (Just 4) (Just $ MockMerge 4)) + + , testCase "merge lattice proposal lists" $ + let + a = LatticeProposal (0, 0) Nothing (Just 2) (Just $ MockMerge 4) :: LatticeProposal Int MockMerge + b = LatticeProposal (1, 0) Nothing (Just 2) (Just $ MockMerge 4) :: LatticeProposal Int MockMerge + c = LatticeProposal (0, 0) (Just 3) (Just 2) (Just $ MockMerge 4) :: LatticeProposal Int MockMerge + d = LatticeProposal (0, 0) (Just 3) (Just 2) (Just $ MockMerge 5) :: LatticeProposal Int MockMerge + in do + (LatticePropList [a, b]) @=? merge (LatticePropList [a]) (LatticePropList [b]) + (LatticePropList [c, b]) @=? merge (LatticePropList [a]) (LatticePropList [b, c]) + (LatticePropList [c]) @=? merge (LatticePropList [a, b]) (LatticePropList [c, d]) + (LatticePropList [b, d]) @=? merge (LatticePropList [b]) (LatticePropList [d]) ] |