Browse Source

Use format_error/1

pull/1984/head
mopp 6 years ago
parent
commit
44b250c174
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/rebar_prv_eunit.erl

+ 3
- 1
src/rebar_prv_eunit.erl View File

@ -105,6 +105,8 @@ format_error({eunit_test_errors, Errors}) ->
lists:map(fun(Error) -> "~n " ++ Error end, Errors)), []); lists:map(fun(Error) -> "~n " ++ Error end, Errors)), []);
format_error({badconfig, {Msg, {Value, Key}}}) -> format_error({badconfig, {Msg, {Value, Key}}}) ->
io_lib:format(Msg, [Value, Key]); io_lib:format(Msg, [Value, Key]);
format_error({generator, Value}) ->
io_lib:format("Generator ~p has an invalid format", [Value]);
format_error({error, Error}) -> format_error({error, Error}) ->
format_error({error_running_tests, Error}). format_error({error_running_tests, Error}).
@ -154,7 +156,7 @@ normalize(generator, Value) ->
lists:map(fun(F) -> {generator, Module, list_to_atom(F)} end, lists:map(fun(F) -> {generator, Module, list_to_atom(F)} end,
string:tokens(Functions, [$;])); string:tokens(Functions, [$;]));
_ -> _ ->
?PRV_ERROR({generator, {"Generator `~p` is invalid format", {Value}}})
?PRV_ERROR({generator, Value})
end; end;
normalize(Key, Value) when Key == dir; Key == file -> {Key, Value}; normalize(Key, Value) when Key == dir; Key == file -> {Key, Value};
normalize(Key, Value) -> {Key, list_to_atom(Value)}. normalize(Key, Value) -> {Key, list_to_atom(Value)}.

Loading…
Cancel
Save