Skip to content

Commit

Permalink
Adjust tests for OTP26
Browse files Browse the repository at this point in the history
  • Loading branch information
elbrujohalcon committed Oct 24, 2024
1 parent 420203a commit 97fca07
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 22 deletions.
2 changes: 2 additions & 0 deletions nextroll.dict
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ lay_clauses
lay_items
old-reliable
otp25
otp26
otp27
paragraph-format
per-file
plugin
Expand Down
11 changes: 10 additions & 1 deletion test/otp_formatter_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ test_app(_Config) ->
case string:to_integer(
erlang:system_info(otp_release))
of
{N, _} when N >= 25 ->
{N, _} when N >= 26 ->
{ignore,
["src/strings/non_heredoc.erl", %% newlines in strings are treated differently since OTP26
"src/*_ignore.erl",
"src/comments.erl",
"src/ignored_file_config.erl",
"src/dodge_macros.erl",
"src/macros_in_specs.erl",
"src/receive_after.erl"]};
{25, _} ->
{ignore,
["src/*_ignore.erl",
"src/comments.erl",
Expand Down
5 changes: 4 additions & 1 deletion test/test_app_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ init_test_app() ->
case string:to_integer(
erlang:system_info(otp_release))
of
{N, []} when N >= 25 ->
{N, _} when N >= 26 ->
%% newlines in strings are treated differently since OTP26
{ignore, ["src/strings/non_heredoc.erl", "src/*_ignore.erl", "src/ignored_file_config.erl"]};
{25, _} ->
{ignore, ["src/*_ignore.erl", "src/ignored_file_config.erl"]};
_ ->
{ignore, ["src/*_ignore.erl", "src/ignored_file_config.erl", "src/otp25.erl"]}
Expand Down
15 changes: 15 additions & 0 deletions test_app/after/src/strings/non_heredoc.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-module(strings).

-export([heredoc/0]).

-format #{inline_expressions => true}.

heredoc() ->
{ok,
"" "
This is
a multiline
heredoc but there are
no multiline heredocs in Erlang :'(
"
""}.
12 changes: 1 addition & 11 deletions test_app/after/src/strings/strings.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,12 @@
-attr({with, "a string"}).

all() ->
heredoc(), superlong(), repeat(), multiple_calls(), characters(), multiline_with_spaces().
superlong(), repeat(), multiple_calls(), characters(), multiline_with_spaces().

superlong() ->
"This is a super super super super super super super super super super super super super super super super super super super super super super super super super super super super super long string!"
"Shouldn't be truncated since truncate_strings => false by default".

heredoc() ->
{ok,
"" "
This is
a multiline
heredoc but there are
no multiline heredocs in Erlang :'(
"
""}.

repeat() ->
["hello", "there", "hello", "there", "hello", "there" | repeat_more()].

Expand Down
15 changes: 15 additions & 0 deletions test_app/src/strings/non_heredoc.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-module(strings).

-export([heredoc/0]).

-format #{inline_expressions => true}.

heredoc() ->
{ok,
"" "
This is
a multiline
heredoc but there are
no multiline heredocs in Erlang :'(
"
""}.
9 changes: 0 additions & 9 deletions test_app/src/strings/strings.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
-attr({with, "a string"}).

all() ->
heredoc(),
superlong(),
repeat(),
multiple_calls(),
Expand All @@ -19,14 +18,6 @@ superlong() ->
"This is a super super super super super super super super super super super super super super super super super super super super super super super super super super super super super long string!"
"Shouldn't be truncated since truncate_strings => false by default".

heredoc() ->
{ok, """
This is
a multiline
heredoc but there are
no multiline heredocs in Erlang :'(
"""}.

repeat() ->
["hello", "there",
"hello", "there",
Expand Down

0 comments on commit 97fca07

Please sign in to comment.