Merge pull request #79 from tsloughter/master

18.0 Support
This commit is contained in:
Jordan Wilberding 2015-04-23 16:16:34 -07:00
commit ef0d252b11
3 changed files with 7 additions and 7 deletions

View file

@ -75,7 +75,7 @@
-type color() :: 31..36. -type color() :: 31..36.
-opaque t() :: record(state_t). -opaque t() :: #state_t{}.
%%============================================================================ %%============================================================================
%% API %% API

View file

@ -931,7 +931,7 @@ iso_test_() ->
]. ].
ms_test_() -> ms_test_() ->
Now=now(), Now=os:timestamp(),
[ [
?_assertEqual({{2012,12,12}, {12,12,12,1234}}, parse("2012-12-12T12:12:12.1234")), ?_assertEqual({{2012,12,12}, {12,12,12,1234}}, parse("2012-12-12T12:12:12.1234")),
?_assertEqual(format("H:m:s.f \\m \\i\\s \\m\\o\\n\\t\\h",?DATEMS), ?_assertEqual(format("H:m:s.f \\m \\i\\s \\m\\o\\n\\t\\h",?DATEMS),

View file

@ -92,16 +92,16 @@ copy(From, To) ->
-spec md5sum(string() | binary()) -> string(). -spec md5sum(string() | binary()) -> string().
md5sum(Value) -> md5sum(Value) ->
hex(binary_to_list(erlang:md5(Value))). hex(binary_to_list(erlang:md5(Value))).
%% @doc return an sha1sum checksum string or a binary. Same as unix utility of %% @doc return an sha1sum checksum string or a binary. Same as unix utility of
%% same name. %% same name.
-ifdef(deprecated_crypto). -ifdef(deprecated_crypto).
-spec sha1sum(string() | binary()) -> string(). -spec sha1sum(string() | binary()) -> string().
sha1sum(Value) -> sha1sum(Value) ->
hex(binary_to_list(crypto:sha(Value))). hex(binary_to_list(crypto:sha(Value))).
-else. -else.
-spec sha1sum(string() | binary()) -> string(). -spec sha1sum(string() | binary()) -> string().
sha1sum(Value) -> sha1sum(Value) ->
hex(binary_to_list(crypto:hash(sha, Value))). hex(binary_to_list(crypto:hash(sha, Value))).
-endif. -endif.
@ -174,7 +174,7 @@ real_dir_path(Path) ->
%% function of the same name. %% function of the same name.
-spec insecure_mkdtemp() -> TmpDirPath::file:name(). -spec insecure_mkdtemp() -> TmpDirPath::file:name().
insecure_mkdtemp() -> insecure_mkdtemp() ->
random:seed(now()), random:seed(os:timestamp()),
UniqueNumber = erlang:integer_to_list(erlang:trunc(random:uniform() * 1000000000000)), UniqueNumber = erlang:integer_to_list(erlang:trunc(random:uniform() * 1000000000000)),
TmpDirPath = TmpDirPath =
filename:join([tmp(), lists:flatten([".tmp_dir", UniqueNumber])]), filename:join([tmp(), lists:flatten([".tmp_dir", UniqueNumber])]),
@ -336,7 +336,7 @@ setup_test() ->
md5sum_test() -> md5sum_test() ->
?assertMatch("cfcd208495d565ef66e7dff9f98764da", md5sum("0")). ?assertMatch("cfcd208495d565ef66e7dff9f98764da", md5sum("0")).
sha1sum_test() -> sha1sum_test() ->
?assertMatch("b6589fc6ab0dc82cf12099d1c2d40ab994e8410c", sha1sum("0")). ?assertMatch("b6589fc6ab0dc82cf12099d1c2d40ab994e8410c", sha1sum("0")).