Skip to content

Commit

Permalink
Act on self-review: go for more compact output
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira committed Mar 6, 2024
1 parent 2da6731 commit e8428ac
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions vendor/cth_readable/src/cth_readable_compact_shell.erl
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,7 @@ init(Id, Opts) ->
{ok, #state{id=Id, opts=Opts, last_suite=undefined}}.

%% @doc Called before init_per_suite is called.
pre_init_per_suite(Suite,Config,#state{opts = Opts, last_suite = LastSuite} = State) ->
IsFirstSuite = LastSuite =:= undefined,
IsVerbose = is_verbose(Opts),
case IsFirstSuite of
false when IsVerbose ->
io:format(user, "~n", []);
_Else ->
ok
end,
pre_init_per_suite(Suite,Config,State) ->
io:format(user, "%%% ~p", [Suite]),
{Config, State#state{suite=Suite, groups=[]}}.

Expand Down Expand Up @@ -127,7 +119,7 @@ post_end_per_testcase(SuiteName,TC,Config,Error,State=#state{suite=Suite, groups
io:format(user, "~n%%% ~p ==> ", [SuiteName]);
true when IsVerbose ->
io:format(user, " ==> ", []);
true when IsFirstInSuite ->
true ->
io:format(user, ": ", []);
_Else ->
ok
Expand Down

0 comments on commit e8428ac

Please sign in to comment.