Przeglądaj źródła

Use same random seeding function for random_name and random_vsn

pull/489/head
Viacheslav V. Kovalev 10 lat temu
rodzic
commit
99858f3b69
1 zmienionych plików z 8 dodań i 3 usunięć
  1. +8
    -3
      test/rebar_test_utils.erl

+ 8
- 3
test/rebar_test_utils.erl Wyświetl plik

@ -105,17 +105,22 @@ create_config(AppDir, Contents) ->
%% @doc Util to create a random variation of a given name.
create_random_name(Name) ->
<<A:32, B:32, C:32>> = crypto:rand_bytes(12),
random:seed({A,B,C}),
random_seed(),
Name ++ erlang:integer_to_list(random:uniform(1000000)).
%% @doc Util to create a random variation of a given version.
create_random_vsn() ->
random:seed(erlang:now()),
random_seed(),
lists:flatten([erlang:integer_to_list(random:uniform(100)),
".", erlang:integer_to_list(random:uniform(100)),
".", erlang:integer_to_list(random:uniform(100))]).
random_seed() ->
<<A:32, B:32, C:32>> = crypto:rand_bytes(12),
random:seed({A,B,C}).
expand_deps(_, []) -> [];
expand_deps(git, [{Name, Deps} | Rest]) ->
Dep = {Name, ".*", {git, "https://example.org/user/"++Name++".git", "master"}},

Ładowanie…
Anuluj
Zapisz