chore(test): hlint told me to use maybe here
This commit is contained in:
parent
c99d96ecb8
commit
7f1df44fc3
@ -40,7 +40,7 @@ import Handler.Utils.Exam
|
|||||||
-- expected: False
|
-- expected: False
|
||||||
-- but got: True
|
-- but got: True
|
||||||
-- @
|
-- @
|
||||||
myAnnotate :: (HasCallStack) => String -> Expectation -> Expectation
|
myAnnotate :: HasCallStack => String -> Expectation -> Expectation
|
||||||
myAnnotate msg = handle $ \(HUnitFailure loc exn) ->
|
myAnnotate msg = handle $ \(HUnitFailure loc exn) ->
|
||||||
throwIO $ HUnitFailure loc $ case exn of
|
throwIO $ HUnitFailure loc $ case exn of
|
||||||
Reason str ->
|
Reason str ->
|
||||||
@ -145,7 +145,7 @@ spec = do
|
|||||||
= (rule == ExamRoomMatriculation)
|
= (rule == ExamRoomMatriculation)
|
||||||
-- every user with a userMatrikelnummer got a room
|
-- every user with a userMatrikelnummer got a room
|
||||||
-- fail on unknown user
|
-- fail on unknown user
|
||||||
|| (fromMaybe False $ isNothing . userMatrikelnummer . fst <$> Map.lookup userId users)
|
|| maybe False (isNothing . userMatrikelnummer . fst) (Map.lookup userId users)
|
||||||
myAnnotate "user didn't get a room" $ shouldSatisfy userMap $ foldr foldFn True . Map.toList
|
myAnnotate "user didn't get a room" $ shouldSatisfy userMap $ foldr foldFn True . Map.toList
|
||||||
-- all users match the shown ranges
|
-- all users match the shown ranges
|
||||||
myAnnotate "shown ranges don't match userMap"
|
myAnnotate "shown ranges don't match userMap"
|
||||||
|
|||||||
Reference in New Issue
Block a user