Add some between tests with the relative tests

This commit is contained in:
Jesse Gumm 2016-04-13 19:39:30 -05:00
parent b550391a4e
commit 795b3d8961

View file

@ -679,7 +679,7 @@ parse_relative(_) ->
%% nested case expressions, but I can deal with it. %% nested case expressions, but I can deal with it.
parse_actual_relation(Relation) -> parse_actual_relation(Relation) ->
PrefixRE = "^(\\-|\\+|in)\\s?(\\d+) (second|minute|hour|day|week|month|year)s?$", PrefixRE = "^(\\-|\\+|in)\\s?(\\d+) (second|minute|hour|day|week|month|year)s?$",
SuffixRE = "^(\\d+) (second|minute|hour|day|week|month|year)s\\s?(ago|from now)?$", SuffixRE = "^(\\d+) (second|minute|hour|day|week|month|year)s?\\s?(ago|from now)?$",
case re:run(Relation, PrefixRE, [{capture, all_but_first, list}]) of case re:run(Relation, PrefixRE, [{capture, all_but_first, list}]) of
nomatch -> nomatch ->
case re:run(Relation, SuffixRE, [{capture, all_but_first, list}]) of case re:run(Relation, SuffixRE, [{capture, all_but_first, list}]) of