implemented editGoalieLtWins
This commit is contained in:
parent
dd34429f59
commit
2860309fc5
|
@ -135,7 +135,7 @@ editGoalieLtWins
|
|||
-- ^ The number of wins
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieLtWins = undefined
|
||||
editGoalieLtWins wins = editGoalie (gLifetime.gsWins .~ wins) EGLifetime
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -42,6 +42,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieLtGamesSpec
|
||||
editGoalieLtMinsSpec
|
||||
editGoalieLtGoalsSpec
|
||||
editGoalieLtWinsSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -384,6 +385,37 @@ editGoalieLtGoalsSpec = describe "editGoalieLtGoals" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieLtWinsSpec :: Spec
|
||||
editGoalieLtWinsSpec = describe "editGoalieLtWins" $ editTest
|
||||
(editGoalieLtWins 1)
|
||||
EGLtWins
|
||||
(\(num, name, wins) -> newGoalie num name & gLifetime.gsWins .~ wins)
|
||||
[ ( "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 )
|
||||
, EGLtWins
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGLtWins
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user