|
|
@@ -958,7 +958,7 @@ prop_format_date_fun() ->
|
|
|
Args1 = [<<"second">>, <<"+07:00">>, <<"%m--%d--%y---%H:%M:%S%Z">>],
|
|
|
?FORALL(
|
|
|
S,
|
|
|
- erlang:system_time(second),
|
|
|
+ range(0, 4000000000),
|
|
|
S ==
|
|
|
apply_func(
|
|
|
date_to_unix_ts,
|
|
|
@@ -974,7 +974,7 @@ prop_format_date_fun() ->
|
|
|
Args2 = [<<"millisecond">>, <<"+04:00">>, <<"--%m--%d--%y---%H:%M:%S%Z">>],
|
|
|
?FORALL(
|
|
|
S,
|
|
|
- erlang:system_time(millisecond),
|
|
|
+ range(0, 4000000000),
|
|
|
S ==
|
|
|
apply_func(
|
|
|
date_to_unix_ts,
|
|
|
@@ -990,7 +990,7 @@ prop_format_date_fun() ->
|
|
|
Args = [<<"second">>, <<"+08:00">>, <<"%y-%m-%d-%H:%M:%S%Z">>],
|
|
|
?FORALL(
|
|
|
S,
|
|
|
- erlang:system_time(second),
|
|
|
+ range(0, 4000000000),
|
|
|
S ==
|
|
|
apply_func(
|
|
|
date_to_unix_ts,
|
|
|
@@ -1002,6 +1002,24 @@ prop_format_date_fun() ->
|
|
|
)
|
|
|
]
|
|
|
)
|
|
|
+ ),
|
|
|
+ %% When no offset is specified, the offset should be taken from the formatted time string
|
|
|
+ ArgsNoOffset = [<<"second">>, <<"%y-%m-%d-%H:%M:%S%Z">>],
|
|
|
+ ArgsOffset = [<<"second">>, <<"+08:00">>, <<"%y-%m-%d-%H:%M:%S%Z">>],
|
|
|
+ ?FORALL(
|
|
|
+ S,
|
|
|
+ range(0, 4000000000),
|
|
|
+ S ==
|
|
|
+ apply_func(
|
|
|
+ date_to_unix_ts,
|
|
|
+ ArgsNoOffset ++
|
|
|
+ [
|
|
|
+ apply_func(
|
|
|
+ format_date,
|
|
|
+ ArgsOffset ++ [S]
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ )
|
|
|
).
|
|
|
|
|
|
%%------------------------------------------------------------------------------
|