diff options
author | sanine <sanine.not@pm.me> | 2023-12-08 14:21:19 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-12-08 14:21:19 -0600 |
commit | b2a8a61b287d232db8dcbb78c9e4a88ab7b8c2a7 (patch) | |
tree | 85dc1013f3d1ad79dca583f3733883a17019559e /test/LatticeTest.hs | |
parent | 15a0b3d4658faced5e5e09c582f4c22365b31ad7 (diff) |
prevent applying invalid proposalsrefactor-haskell
Diffstat (limited to 'test/LatticeTest.hs')
-rw-r--r-- | test/LatticeTest.hs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/LatticeTest.hs b/test/LatticeTest.hs index 9edff30..40c0a85 100644 --- a/test/LatticeTest.hs +++ b/test/LatticeTest.hs @@ -94,7 +94,7 @@ proposalApplication = testGroup "apply proposal lists to lattices" $ in lattice' @?= [ [ LatticeCell Plant (Just False) - , LatticeCell Plant (Just True) + , LatticeCell Plant Nothing -- reset by the application process , LatticeCell Plant (Just True) ] ] @@ -113,5 +113,19 @@ proposalApplication = testGroup "apply proposal lists to lattices" $ [ LatticeCell Plant (MergeInt $ 0-6) ] ] + , testCase "invalid proposals are not applied" $ + let + plant = LatticeCell Plant Nothing + empty = LatticeCell Empty Nothing + lattice = [[ empty, plant, empty ]] + proposals :: LatticePropList GrowKind (Maybe Bool) + proposals = LatticePropList + [ LatticeProposal (0, 0) Plant Plant Nothing + , LatticeProposal (1, 0) Plant Empty Nothing + , LatticeProposal (2, 0) Empty Plant Nothing + ] + lattice' = applyLatticeProposals lattice proposals + in + lattice' @?= [[ empty, empty, plant ]] ] |