Skip to content
Snippets Groups Projects
Commit 37cbfe5d authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

tests: Add more tests for splitBlock

parent bc438245
Branches
Tags
No related merge requests found
......@@ -157,15 +157,42 @@ splitBlockSpec = describe "splitBlock" $ do
$ let res = withState @Powerset (enc [True, False] [(0, (), 1)]) $ do
[(b, v0)] <- collectTouchedBlocks (Block 1)
updateBlock b v0
lift . Queue.clear =<< view _2
splitBlock b
in res `shouldBe` [0]
it "splits blocks into marked and unmaked" $
let res = withState @Powerset (enc [True, True, False] [(0, (), 2), (1, (), 0)]) $ do
it "splits blocks into marked and unmaked"
$ let
res =
withState @Powerset (enc [True, True, False] [(0, (), 2), (1, (), 0)])
$ do
[(b, v0)] <- collectTouchedBlocks (Block 1)
updateBlock b v0
splitBlock b
in res `shouldMatchList` [Block 0, Block 2]
it "splits different H3s into different blocks"
$ let
res =
withState @(MonoidValued Int)
(enc [3, 3, 3, 0]
[(0, 1, 3), (1, 2, 3), (2, 3, 3), (0, 2, 0), (1, 1, 1)]
)
$ do
[(b, v0)] <- collectTouchedBlocks (Block 1)
updateBlock b v0
splitBlock b
in res `shouldMatchList` [Block 0, Block 2, Block 3]
it "combines equal H3s into the same block"
$ let
res =
withState @(MonoidValued Int)
(enc [3, 3, 3, 0]
[(0, 1, 3), (1, 1, 3), (2, 3, 3), (0, 2, 0), (1, 2, 1)]
)
$ do
[(b, v0)] <- collectTouchedBlocks (Block 1)
updateBlock b v0
lift . Queue.clear =<< view _2
splitBlock b
in res `shouldMatchList` [Block 0, Block 2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment