From 9d8b06198bc74a2a1997e0eebb2cf28802bb0d31 Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Mon, 23 Sep 2024 07:54:30 +0200 Subject: [PATCH] List-foreaching some list comprehensions Co-authored-by: Brujo Benavides --- test/wpool_SUITE.erl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/wpool_SUITE.erl b/test/wpool_SUITE.erl index 99ae2e3..e2febe3 100644 --- a/test/wpool_SUITE.erl +++ b/test/wpool_SUITE.erl @@ -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))