chore(test): fix type errors + add more surnames
This commit is contained in:
parent
d5b1203d53
commit
2ee7f41d05
@ -136,7 +136,7 @@ spec = do
|
|||||||
case maybeMapping of
|
case maybeMapping of
|
||||||
(Just occurrenceMapping) -> do
|
(Just occurrenceMapping) -> do
|
||||||
-- mapping is a valid description
|
-- mapping is a valid description
|
||||||
myAnnotate "invalid mapping description" $ shouldSatisfy occurrenceMapping validRangeDescription
|
myAnnotate "invalid mapping description" $ shouldSatisfy (rule, occurrenceMapping) $ uncurry validRangeDescription
|
||||||
-- every (relevant) user got assigned a room
|
-- every (relevant) user got assigned a room
|
||||||
let foldFn :: (UserId, Maybe ExamOccurrenceId) -> Bool -> Bool
|
let foldFn :: (UserId, Maybe ExamOccurrenceId) -> Bool -> Bool
|
||||||
foldFn _userMapping False = False
|
foldFn _userMapping False = False
|
||||||
@ -196,6 +196,9 @@ spec = do
|
|||||||
, "Lopez", "Lee", "Gonzalez", "Harris"
|
, "Lopez", "Lee", "Gonzalez", "Harris"
|
||||||
, "Clark", "Lewis", "Robinson", "Walker"
|
, "Clark", "Lewis", "Robinson", "Walker"
|
||||||
, "Perez", "Hall", "Young", "zu Allen", "Fu"
|
, "Perez", "Hall", "Young", "zu Allen", "Fu"
|
||||||
|
, "Meier", "Meyer", "Maier", "Mayer"
|
||||||
|
, "Meir", "Müller", "Schulze", "Schmitt"
|
||||||
|
, "FTB Modul", "Mártinèz", "zu Walker", "Schmidt"
|
||||||
, "Únîcòdé", "Ähm-Ümlaüte", "von Leerzeichen"
|
, "Únîcòdé", "Ähm-Ümlaüte", "von Leerzeichen"
|
||||||
]
|
]
|
||||||
occurrenceMap :: Map UserId (Maybe ExamOccurrenceId) -> Map ExamOccurrenceId [UserId]
|
occurrenceMap :: Map UserId (Maybe ExamOccurrenceId) -> Map ExamOccurrenceId [UserId]
|
||||||
@ -219,8 +222,8 @@ spec = do
|
|||||||
(Just capacity) -> length userIds <= fromIntegral capacity
|
(Just capacity) -> length userIds <= fromIntegral capacity
|
||||||
|| all (isJust . snd) (Map.restrictKeys userProperties $ Set.fromList userIds)
|
|| all (isJust . snd) (Map.restrictKeys userProperties $ Set.fromList userIds)
|
||||||
-- | No range overlap for different rooms + end is always the greater value
|
-- | No range overlap for different rooms + end is always the greater value
|
||||||
validRangeDescription :: ExamOccurrenceMapping ExamOccurrenceId -> Bool
|
validRangeDescription :: ExamOccurrenceRule -> ExamOccurrenceMapping ExamOccurrenceId -> Bool
|
||||||
validRangeDescription ExamOccurrenceMapping {examOccurrenceMappingMapping}
|
validRangeDescription rule ExamOccurrenceMapping {examOccurrenceMappingMapping}
|
||||||
= all (\(roomId, ranges) -> all (descriptionValid roomId) ranges) $ Map.toAscList examOccurrenceMappingMapping
|
= all (\(roomId, ranges) -> all (descriptionValid roomId) ranges) $ Map.toAscList examOccurrenceMappingMapping
|
||||||
where
|
where
|
||||||
descriptionValid:: ExamOccurrenceId -> ExamOccurrenceMappingDescription -> Bool
|
descriptionValid:: ExamOccurrenceId -> ExamOccurrenceMappingDescription -> Bool
|
||||||
@ -254,7 +257,7 @@ spec = do
|
|||||||
= equalLengthForMatriculation [s0, s1] && s0 /= s1
|
= equalLengthForMatriculation [s0, s1] && s0 /= s1
|
||||||
equalLengthForMatriculation :: [[CI Char]] -> Bool
|
equalLengthForMatriculation :: [[CI Char]] -> Bool
|
||||||
equalLengthForMatriculation [] = True
|
equalLengthForMatriculation [] = True
|
||||||
equalLengthForMatriculation (h:t) = (rule /= ExamRoomMatriculation) || all (== Text.length h) (Text.length <$> t)
|
equalLengthForMatriculation (h:t) = (rule /= ExamRoomMatriculation) || all (== length h) (length <$> t)
|
||||||
noDirectOverlapRangeSpecial :: [CI Char] -> [CI Char] -> [CI Char] -> Bool
|
noDirectOverlapRangeSpecial :: [CI Char] -> [CI Char] -> [CI Char] -> Bool
|
||||||
noDirectOverlapRangeSpecial
|
noDirectOverlapRangeSpecial
|
||||||
(pack . map CI.foldedCase -> start)
|
(pack . map CI.foldedCase -> start)
|
||||||
|
|||||||
Reference in New Issue
Block a user