From 7f1df44fc3567657c3a67dc1179e593bffcebed1 Mon Sep 17 00:00:00 2001 From: Wolfgang Witt Date: Thu, 25 Feb 2021 23:30:54 +0100 Subject: [PATCH] chore(test): hlint told me to use maybe here --- test/Handler/Utils/ExamSpec.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Handler/Utils/ExamSpec.hs b/test/Handler/Utils/ExamSpec.hs index a9b6c1e82..8f7fc1e02 100644 --- a/test/Handler/Utils/ExamSpec.hs +++ b/test/Handler/Utils/ExamSpec.hs @@ -40,7 +40,7 @@ import Handler.Utils.Exam -- expected: False -- but got: True -- @ -myAnnotate :: (HasCallStack) => String -> Expectation -> Expectation +myAnnotate :: HasCallStack => String -> Expectation -> Expectation myAnnotate msg = handle $ \(HUnitFailure loc exn) -> throwIO $ HUnitFailure loc $ case exn of Reason str -> @@ -145,7 +145,7 @@ spec = do = (rule == ExamRoomMatriculation) -- every user with a userMatrikelnummer got a room -- 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 -- all users match the shown ranges myAnnotate "shown ranges don't match userMap"