Skip to content

Commit

Permalink
[#197] Fix #197: Organize Tests (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brujo Benavides authored Apr 7, 2021
1 parent b9579da commit d465ad2
Show file tree
Hide file tree
Showing 109 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion test/otp_formatter_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ test_app(_Config) ->
{ok, State1} =
rebar3_format:init(
rebar_state:new()),
Files = {files, ["src/*.app.src", "src/*.sh", "src/*.erl", "include/*.hrl"]},
Files =
{files, ["src/*.app.src", "src/*.sh", "src/*.erl", "src/*/*.erl", "include/*.hrl"]},
Formatter = {formatter, otp_formatter},
IgnoredFiles =
case string:to_integer(
Expand Down
3 changes: 2 additions & 1 deletion test/test_app_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ test_app(_Config) ->
{ok, State1} =
rebar3_format:init(
rebar_state:new()),
Files = {files, ["src/*.app.src", "src/*.sh", "src/*.erl", "include/*.hrl"]},
Files =
{files, ["src/*.app.src", "src/*.sh", "src/*.erl", "src/*/*.erl", "include/*.hrl"]},
IgnoredFiles =
case string:to_integer(
erlang:system_info(otp_release))
Expand Down
1 change: 1 addition & 0 deletions test_app/after/src/brackets_ignore.erl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%% This module should not be formatted since it's in the list of ignored modules
-module(brackets_ignore).

-format(#{paper => 50, inline_items => all}).
Expand Down
16 changes: 9 additions & 7 deletions test_app/after/src/break.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

-compile(export_all).

%% receive...after...end is never a one-liner
break_on_receive() ->
receive
{this, will, be, indented} ->
but_this:is(short)
x ->
y
after 1000 ->
this:too(should, go, below)
z
end.

%% try...of...after...end is never a one-liner
break_on_try() ->
try this:short(statement) of
{things, cant, be} ->
{a, <<"one-liner">>}
try w of
x ->
y
after
this:neither()
z
end.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion test_app/after/src/test_empty.erl

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test_app/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{project_plugins, [rebar3_format]}.

{format, [
{files, ["src/*.erl", "include/*.hrl"]},
{files, ["src/*.erl", "src/*/*.erl", "include/*.hrl"]},
{ignore, ["src/*_ignore.erl", "src/ignored_file_config.erl"]},
{options, #{dummy => option}}
]}.
1 change: 1 addition & 0 deletions test_app/src/brackets_ignore.erl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%% This module should not be formatted since it's in the list of ignored modules
-module(brackets_ignore).

-format(#{paper => 50, inline_items => all}).
Expand Down
10 changes: 4 additions & 6 deletions test_app/src/break.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

-compile(export_all).

%% receive...after...end is never a one-liner
break_on_receive() ->
receive
{this, will, be, indented} -> but_this:is(short)
after 1000 -> this:too(should, go, below)
end.
receive x -> y after 1000 -> z end.

%% try...of...after...end is never a one-liner
break_on_try() ->
try this:short(statement) of
{things, cant, be} -> {a, <<"one-liner">>} after this:neither() end.
try w of x -> y after z end.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions test_app/src/test_empty.erl

This file was deleted.

File renamed without changes.
File renamed without changes.

0 comments on commit d465ad2

Please sign in to comment.