Skip to content

Commit

Permalink
List-foreaching some list comprehensions
Browse files Browse the repository at this point in the history
Co-authored-by: Brujo Benavides <elbrujohalcon@gmail.com>
  • Loading branch information
NelsonVides and elbrujohalcon committed Sep 23, 2024
1 parent 6b352e9 commit 9d8b061
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/wpool_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,13 @@ pool_of_supervisors(_Config) ->
{ok, Pid} = wpool:start_sup_pool(pool_of_supervisors, Opts),
true = erlang:is_process_alive(Pid),

[begin
Run = fun(Sup) -> supervisor:start_child(Sup, [{ok, #{}}]) end,
{ok, EchoServer} = wpool:run(pool_of_supervisors, Run, next_worker),
true = erlang:is_process_alive(EchoServer)
end
|| _N <- lists:seq(1, 9)],
Run = fun(Sup, _) -> supervisor:start_child(Sup, [{ok, #{}}]) end,
ForEach =
fun(_) ->
{ok, EchoServer} = wpool:run(pool_of_supervisors, Run, next_worker),
true = erlang:is_process_alive(EchoServer)
end,
lists:foreach(ForEach, lists:seq(1, 9)),

Supervisors = wpool:get_workers(pool_of_supervisors),
[3 = proplists:get_value(active, supervisor:count_children(Supervisor))
Expand Down

0 comments on commit 9d8b061

Please sign in to comment.