implemented editGoalieLtGoals
This commit is contained in:
parent
c0386fa0b9
commit
954fe98998
|
@ -126,7 +126,7 @@ editGoalieLtGoals
|
||||||
-- ^ The number of goals
|
-- ^ The number of goals
|
||||||
-> ProgState
|
-> ProgState
|
||||||
-> ProgState
|
-> ProgState
|
||||||
editGoalieLtGoals = undefined
|
editGoalieLtGoals goals = editGoalie (gLifetime.gsGoalsAllowed .~ goals) EGLifetime
|
||||||
|
|
||||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||||
editGoalie f mode s = fromMaybe s $ do
|
editGoalie f mode s = fromMaybe s $ do
|
||||||
|
|
|
@ -41,6 +41,7 @@ spec = describe "EditGoalie" $ do
|
||||||
editGoalieYtdTiesSpec
|
editGoalieYtdTiesSpec
|
||||||
editGoalieLtGamesSpec
|
editGoalieLtGamesSpec
|
||||||
editGoalieLtMinsSpec
|
editGoalieLtMinsSpec
|
||||||
|
editGoalieLtGoalsSpec
|
||||||
|
|
||||||
editGoalieNumberSpec :: Spec
|
editGoalieNumberSpec :: Spec
|
||||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||||
|
@ -352,6 +353,37 @@ editGoalieLtMinsSpec = describe "editGoalieLtMins" $ editTest
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
editGoalieLtGoalsSpec :: Spec
|
||||||
|
editGoalieLtGoalsSpec = describe "editGoalieLtGoals" $ editTest
|
||||||
|
(editGoalieLtGoals 1)
|
||||||
|
EGLtGoals
|
||||||
|
(\(num, name, goals) -> newGoalie num name & gLifetime.gsGoalsAllowed .~ goals)
|
||||||
|
[ ( "set Joe"
|
||||||
|
, Just 0
|
||||||
|
, ( 2, "Joe", 1 )
|
||||||
|
, ( 3, "Bob", 0 )
|
||||||
|
, EGLifetime
|
||||||
|
)
|
||||||
|
, ( "set Bob"
|
||||||
|
, Just 1
|
||||||
|
, ( 2, "Joe", 0 )
|
||||||
|
, ( 3, "Bob", 1 )
|
||||||
|
, EGLifetime
|
||||||
|
)
|
||||||
|
, ( "out of bounds"
|
||||||
|
, Just 2
|
||||||
|
, ( 2, "Joe", 0 )
|
||||||
|
, ( 3, "Bob", 0 )
|
||||||
|
, EGLtGoals
|
||||||
|
)
|
||||||
|
, ( "no goalie selected"
|
||||||
|
, Nothing
|
||||||
|
, ( 2, "Joe", 0 )
|
||||||
|
, ( 3, "Bob", 0 )
|
||||||
|
, EGLtGoals
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
editTest
|
editTest
|
||||||
:: (ProgState -> ProgState)
|
:: (ProgState -> ProgState)
|
||||||
-> EditGoalieMode
|
-> EditGoalieMode
|
||||||
|
|
Loading…
Reference in New Issue
Block a user