implemented editGoalieLtTies
This commit is contained in:
parent
61d788cb4e
commit
5b9c18730c
|
@ -153,7 +153,7 @@ editGoalieLtTies
|
|||
-- ^ The number of ties
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieLtTies = undefined
|
||||
editGoalieLtTies ties = editGoalie (gLifetime.gsTies .~ ties) EGLifetime
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -44,6 +44,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieLtGoalsSpec
|
||||
editGoalieLtWinsSpec
|
||||
editGoalieLtLossesSpec
|
||||
editGoalieLtTiesSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -448,6 +449,37 @@ editGoalieLtLossesSpec = describe "editGoalieLtLosses" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieLtTiesSpec :: Spec
|
||||
editGoalieLtTiesSpec = describe "editGoalieLtTies" $ editTest
|
||||
(editGoalieLtTies 1)
|
||||
EGLtTies
|
||||
(\(num, name, ties) -> newGoalie num name & gLifetime.gsTies .~ ties)
|
||||
[ ( "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 )
|
||||
, EGLtTies
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGLtTies
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user