implemented moving to top and bottom rungs

This commit is contained in:
2024-08-22 19:07:38 -04:00
parent 04e90481de
commit 2f50ed51be
4 changed files with 53 additions and 1 deletions

View File

@@ -33,6 +33,8 @@ spec :: Spec
spec = describe "Actions" $ do
moveUpSpec
moveDownSpec
topRungSpec
bottomRungSpec
selRungSpec
beadLeftSpec
beadRightSpec
@@ -69,6 +71,18 @@ moveDownSpec = describe "moveDown" $ mapM_
elsewhere = initialState & rungNum .~ 8
movedDown = initialState & rungNum .~ 1
topRungSpec :: Spec
topRungSpec = describe "topRung" $ let
state = initialState & rungNum .~ 5
in it ("should be " ++ show initialState) $
topRung state `shouldBe` initialState
bottomRungSpec :: Spec
bottomRungSpec = describe "bottomRung" $ let
expected = initialState & rungNum .~ 9
in it ("should be " ++ show expected) $
bottomRung initialState `shouldBe` expected
selRungSpec :: Spec
selRungSpec = describe "selRung" $ mapM_
( \(desc, rung, expected) -> context desc $