Add field step tests

This commit is contained in:
2017-11-12 07:35:36 +03:00
parent ac5a5078f3
commit cd33a99b84
2 changed files with 20 additions and 0 deletions

View File

@ -71,3 +71,8 @@ parseSequence text constraint
numbers = map read pieces
allInRange = all (\x -> x `inRange` constraint) numbers
isValid = length pieces >= 2 && isAllNumbers && allInRange
parseFieldStep :: String -> Maybe Step
parseFieldStep "" = Just Every
parseFieldStep text | isNumber text = Just (Step (read text))
parseFieldStep _ = Nothing