implemented editGoalieLtLosses
This commit is contained in:
parent
3ba3875752
commit
9456102935
|
@ -144,7 +144,7 @@ editGoalieLtLosses
|
|||
-- ^ The number of losses
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieLtLosses = undefined
|
||||
editGoalieLtLosses losses = editGoalie (gLifetime.gsLosses .~ losses) EGLifetime
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -43,6 +43,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieLtMinsSpec
|
||||
editGoalieLtGoalsSpec
|
||||
editGoalieLtWinsSpec
|
||||
editGoalieLtLossesSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -416,6 +417,37 @@ editGoalieLtWinsSpec = describe "editGoalieLtWins" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieLtLossesSpec :: Spec
|
||||
editGoalieLtLossesSpec = describe "editGoalieLtLosses" $ editTest
|
||||
(editGoalieLtLosses 1)
|
||||
EGLtLosses
|
||||
(\(num, name, losses) -> newGoalie num name & gLifetime.gsLosses .~ losses)
|
||||
[ ( "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 )
|
||||
, EGLtLosses
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGLtLosses
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user